-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add resource_secret and resource_access_secret #454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome addition! I see a bunch of spots where things were already reviewed and fixed (e.g., #451), so a rebase is needed to iron out those. QA steps needed.
Needs a final review and QA after those and the current comments are addressed 👍
ae0f045
to
d8d3763
Compare
e9466db
to
ac50a66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for noticing this late. We should name this new resource access_secret to be consistent with access_model.
You need the example.tf and import.sh files for the documents to create the new docs/resources/access_model.md
ac2b124
to
2769399
Compare
go.mod
Outdated
@@ -22,6 +22,7 @@ require ( | |||
github.com/juju/cmd/v3 v3.0.14 | |||
github.com/juju/collections v1.0.4 | |||
github.com/juju/errors v1.0.0 | |||
github.com/juju/names/v4 v4.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have direct use of names/v4 again? This was removed in a PR which landed yesterday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we did not get rid of it completely. It looks like it is used in application_test.go
resource_model.go
still.
Caner is out an unable to re-review - I've taken over reviewing the changes.
I'll fix Import for both resources in a follow on PR shortly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just need to rebase.
e1a2041
to
c85c1bf
Compare
This commit introduces internal/juju/userSecret and adds method to add user secrets. Implement internal Juju secrets add, update, and remove functionality This commit introduces several changes to the Juju client in the `internal/juju/client.go` file. It includes the implementation of methods for adding, updating, and removing secrets. Additionally, Furthermore, the commit includes changes to the `secret.go` file, introducing new types for managinng secrets. It also includes changes to the `interfaces.go` file, defining new interfaces for the Juju client API. Add secretURI to UpdateSecret Add secretURI to DeleteSecret Add AutoPrunt to UpdateSecret schema Add SecretId to ReadSecret func instead of name. Add lost Asserts. Add secretNotFoundError Extract mocks creation into separate suite. Introduce typedError(err) usage in ClientAPI funcs. Add renaming to UpdateSecret Use struct raather than pointer for Output structures. Introcue NewName in Update input struct. Use pointers in all places in structs where the parameter is not neccessary. Implement schema for user secrets management This commit introduces the ability to add, update, and remove user secrets in the schema. This is done through the `userSecretResource` struct, which has methods for each of these actions. The `Add`, `Update`, and `Remove` methods are currently stubbed out and will need to be implemented in future commits. Add ReadSecret function implementation. Implement Delete secret function Add base64 encoding co Create and change Read fucntion to get value with decode. Add base64 encoding for values in Update
c85c1bf
to
d41084a
Compare
Description
This PR introduces the ability to manage secret access in the Juju provider.
It includes the creation, reading, updating, and deletion of secret access.
The changes also handle the granting and revoking of secret access to applications.
Additionally, it includes the necessary error handling and diagnostics for these operations.
Fixes:
Type of change
Environment
Juju controller version:
Terraform version:
QA steps
After check that secrets created and granted:
Change the list of apps in plan and check secret info again.
Additional notes
JUJU-5711