feat: add dynamic secret API#4667
Conversation
c320da9 to
0f1f580
Compare
2e7b00f to
1de281b
Compare
b5f16c1 to
647a557
Compare
9972261 to
944e2ec
Compare
944e2ec to
3a11eb1
Compare
|
The current implementation of this secret use a new encoding instead of reusing the payload encoding. It works and passes tests. |
|
Finally found the problem, will update this one. Hopefully tonight. |
ee910cd to
061635b
Compare
Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
Signed-off-by: Joel Longtine <joel@longtine.io>
Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
ad5c73a to
44d3abe
Compare
Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
vito
left a comment
There was a problem hiding this comment.
Looking good, mostly nitpicks! I like the idea of storing a digest in the SecretID to keep them deterministic. 👍
Co-authored-by: Alex Suraci <suraci.alex@gmail.com> Signed-off-by: Tanguy ⧓ Herrmann <dolanorgit@evereska.org>
Co-authored-by: Alex Suraci <suraci.alex@gmail.com> Signed-off-by: Tanguy ⧓ Herrmann <dolanorgit@evereska.org>
Co-authored-by: Alex Suraci <suraci.alex@gmail.com> Signed-off-by: Tanguy ⧓ Herrmann <dolanorgit@evereska.org>
Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
The secret ID is already a name + digest Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
(more idiomatic) Signed-off-by: Tanguy ⧓ Herrmann <tanguy@dagger.io>
sipsma
left a comment
There was a problem hiding this comment.
Sorry for the late unhelpful review, but looks great, happy we finally get this!
This PR adds a top level query
setSecret(name: String!, plaintext: String!): Secret!that will associate a user defined secretnameto aplaintextvalue.Points to figure out
file.secret()deprecationAt the same time, we deprecate
file.secret()as it leaks secrets in the cache. It is not a breaking change, yet. But as it is insecure, I thought of actually breaking thefile.secret()implementation (especially the one bringing the secret in) by always returning an error. We wouldn't want people to use it nonetheless and have important secrets leaked.=> viewed with @jlongtine : we keep backwards compatibility, no breaking change
secret id content
The only information going into the container information would be the secret id which is a base64 of the name of the secret and the sha256(plaintext). It should bust the cache if we change the plaintext. I think this is the behavior that we want. But it would be less secure than if we used a hash only derived from the secret name. In that case, nobody would know if the secret plaintext has been changed, and the cached version would be used. The user would have to bust their cache by themselves.
I'm open to discussion/experience sharing about this.