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

Refactor storage credentials #14787

Open
dbolduc opened this issue Oct 15, 2024 · 1 comment
Open

Refactor storage credentials #14787

dbolduc opened this issue Oct 15, 2024 · 1 comment
Labels
api: storage Issues related to the Cloud Storage API. type: cleanup An internal cleanup or hygiene concern.

Comments

@dbolduc
Copy link
Member

dbolduc commented Oct 15, 2024

Storage introduced credentials in the public namespace google::cloud::storage::oauth2. These credential classes are now deprecated in favor of GUAC (google::cloud::Credentials):

* @deprecated Prefer using the unified credentials documented in @ref guac

However, the storage internals are implemented in terms of google::cloud::storage::oauth2::Credentials.

internal::DefaultOptionsWithCredentials(std::move(opts))) {}

We map GUAC -> storage credentials.

if (opts.has<UnifiedCredentialsOption>()) {
auto credentials =
internal::MapCredentials(*opts.get<UnifiedCredentialsOption>());
return internal::DefaultOptions(std::move(credentials), std::move(opts));
}

This is backwards. We need to map storage credentials to GUAC and use GUAC in the implementation, if we ever want to remove the deprecated credentials in google::cloud::storage::oauth2.

@dbolduc dbolduc added api: storage Issues related to the Cloud Storage API. type: cleanup An internal cleanup or hygiene concern. labels Oct 15, 2024
@dbolduc
Copy link
Member Author

dbolduc commented Oct 16, 2024

For the record, we do not need to refactor. We can "delete" the storage::oauth2 classes by moving them into storage_internal and keeping the implementation mostly the same.

We might do this to unblock the next major release.

It is just that the resulting implementation would be unnecessarily complicated compared with using GUAC types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

No branches or pull requests

1 participant