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

[JetpackAPIStore] use apiClient #238

Merged
merged 2 commits into from
Dec 20, 2023
Merged

[JetpackAPIStore] use apiClient #238

merged 2 commits into from
Dec 20, 2023

Conversation

savil
Copy link
Contributor

@savil savil commented Dec 20, 2023

Summary

This uses the new apiClient, which has the benefit of managing the Authorization
header from the token, as well as creating the SecretsService client just once.

I chose to avoid re-defining the SecretsService's methods again. Would prefer
benefitting from the codegen we get and directly using that.

How was it tested?

envsec ls and envsec set work as before

Copy link
Contributor Author

savil commented Dec 20, 2023

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@savil savil force-pushed the savil/envsec-api-store-client branch from 9d369ff to 6d65761 Compare December 20, 2023 18:51
@savil savil requested a review from mikeland73 December 20, 2023 18:53
@savil savil marked this pull request as ready for review December 20, 2023 18:53
}

// JetpackAPIStore implements interface Store (compile-time check)
var _ Store = (*JetpackAPIStore)(nil)

func newJetpackAPIStore(config *JetpackAPIConfig) *JetpackAPIStore {
return &JetpackAPIStore{config: config}
return &JetpackAPIStore{
client: api.NewClient(context.Background(), config.host, config.token).SecretsService(),
Copy link
Contributor

Choose a reason for hiding this comment

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

pass top level context

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! my copy-pasta bad

@savil savil force-pushed the savil/envsec-api-store-client branch from 6d65761 to ce2f781 Compare December 20, 2023 19:46
@savil savil changed the base branch from savil/fix-dev-build to main December 20, 2023 19:46
@savil savil merged commit 4b11c6a into main Dec 20, 2023
2 checks passed
@savil savil deleted the savil/envsec-api-store-client branch December 20, 2023 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants