Hello joey,
First let me thank you and other contributors for this great tool, it helps me a lot in my day to day work
I need to checkout something from a private area of a gitlab instance. In order to authenticate, I setup a personnal access token [1].
It seems to me that PrivData is the right type to use in order to store it and avoid to have the token in clear text in the config.hs file.
I will use it in order to generate the url of the Git type.
(Git "https://:@gitlab.xxxx.yy/user name/blabla.git" Nothing "")
This is the first time I will try to use the privdata and I do not know how to proceed.
I saw that only a certain amount of constructors are available for these privdata. Should I add a new one for my gitlab personnal access token ?.
What is the context which can be attach to the privdata in order to have something as flexible as possible ? It seems to me that the contex should be the gitlab url and the user name, but maybe you could think about a better solution.
Could you explain with a code snipset how to proceed, becasue it is not really clear to me. Or point to an available example.
thanks for your help
Frederic
[1] https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
Privdata uses the combination of the Context and the PrivDataField to identify the piece of private data to use. So, you don't need to add a new constructor to PrivDataField as long as you can find a context that is sufficiently specific for your needs. The gitlab url (without the password) would make a fine context.
So, I'd suggest something like
withPrivData (Password "thegitlaburl") (Context "thegitlaburl")
See the example in the haddock for withPrivData to for how to use that.
(The only possible problem with that is you're claiming it's a password when it's really an API key. Propellor won't care, but it you wanted to store the actual gitlab password too, then you'd need to use a different username. It may make sense to add a new constructor to PrivDataField for an API key or something like that.)
Hello, joey
I try this but It ends up with an error during the compilation
here the error
It seems to me that this is an error with the HasInfo, but I could not manage to solve this problem by myself.
do you have a Idea in ordert o solve this ?
thanks
Frederic
Yes, ensureProperty cannot be used with a Property HasInfo as that would prevent propellor from collecting that Info.
You could avoid that by factoring the
blabla'
out of the properties that install packages, to the top level of the property:Thanks a lot,
if I understand correctly,it means that it is not possible to use withPrivData with ensureProperty if the property HasInfo.
Cheers
Fred