Skip to content
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

Implement methods for user secrets management #442

Conversation

anvial
Copy link
Member

@anvial anvial commented Mar 27, 2024

Description

This PR introduces internal/juju/userSecret and adds method to add user secrets.

Fixes:

Type of change

  • Other (please describe)

Extend internal juju client functionality to implement new User secretes resources and data source.

QA steps

go test github.com/juju/terraform-provider-juju/internal/juju/... -v

@anvial anvial force-pushed the JUJU-5713-implement-internal-juju-user-secrets-add-update-remove branch from ab59f89 to fd55d5a Compare April 1, 2024 18:16
@anvial anvial requested a review from hmlanigan April 1, 2024 18:17
@anvial anvial changed the title [WIP] Implement methods for user secrets management Implement methods for user secrets management Apr 1, 2024
Copy link
Member

@hmlanigan hmlanigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to start. A few details need looking at.

internal/juju/secrets_test.go Outdated Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/secrets.go Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/secrets_test.go Outdated Show resolved Hide resolved
internal/juju/secrets_test.go Outdated Show resolved Hide resolved
internal/juju/secrets_test.go Outdated Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
@hmlanigan hmlanigan added this to the 0.12.0 milestone Apr 2, 2024
internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/common_test.go Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
@anvial anvial force-pushed the JUJU-5713-implement-internal-juju-user-secrets-add-update-remove branch from b492242 to 78f7a60 Compare April 3, 2024 10:44
@anvial anvial requested a review from hmlanigan April 3, 2024 10:44
Copy link
Contributor

@Aflynn50 Aflynn50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

internal/juju/secrets.go Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/secrets_test.go Outdated Show resolved Hide resolved
@anvial anvial force-pushed the JUJU-5713-implement-internal-juju-user-secrets-add-update-remove branch from 2bcabd3 to 2136d39 Compare April 5, 2024 14:00
Copy link
Member

@hmlanigan hmlanigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few quick things to resolve before merging please.

internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
internal/juju/secrets_test.go Outdated Show resolved Hide resolved
@anvial anvial force-pushed the JUJU-5713-implement-internal-juju-user-secrets-add-update-remove branch from 2210a58 to 520fba0 Compare April 8, 2024 09:47
@anvial anvial requested a review from hmlanigan April 8, 2024 09:47
@anvial anvial force-pushed the JUJU-5713-implement-internal-juju-user-secrets-add-update-remove branch from 520fba0 to 86933db Compare April 8, 2024 15:00
internal/juju/secrets.go Show resolved Hide resolved
internal/juju/secrets.go Outdated Show resolved Hide resolved
@anvial anvial force-pushed the JUJU-5713-implement-internal-juju-user-secrets-add-update-remove branch 3 times, most recently from 0fb39c5 to c4fd529 Compare April 11, 2024 17:09
@anvial anvial requested a review from hmlanigan April 11, 2024 17:10
Copy link
Member

@hmlanigan hmlanigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A linter issue to fix, otherwise LGTM. We can iterate some once the provider code is written.

@anvial anvial force-pushed the JUJU-5713-implement-internal-juju-user-secrets-add-update-remove branch from c4fd529 to 2aa33c5 Compare April 11, 2024 17:48
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.

Add base64 encoding co Create and change Read fucntion to get value with
decode.

Add base64 encoding for values in Update
@anvial anvial force-pushed the JUJU-5713-implement-internal-juju-user-secrets-add-update-remove branch from 2aa33c5 to e8358e8 Compare April 11, 2024 18:24
@anvial anvial merged commit 7951fea into juju:main Apr 11, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants