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

Create a public API to get access token #11920

Closed
coryan opened this issue Jun 20, 2023 · 0 comments · Fixed by #12064
Closed

Create a public API to get access token #11920

coryan opened this issue Jun 20, 2023 · 0 comments · Fixed by #12064
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@coryan
Copy link
Contributor

coryan commented Jun 20, 2023

The APIs to get (and cache) access tokens are all in *internal* namespaces. We need a simple API to create access tokens.

Maybe something like this:

namespace google::cloud {
struct AccessToken { std::string token; std::chrono::time_point expiration; };

class AccessTokenGenerator {
 public:
   virtual ~AccessTokenGenerator() = default;
   virtual StatusOr<AccessToken> GetToken() = 0;
};

std::shared_ptr<AccessTokenGenerator> MakeAccessTokenGenerator(std::shared_ptr<Credentials>);

That is a fairly minimal API, whatever our implementation details we will always have enough to support it.

We need to think about the name of the libraries too. All of this lives in rest_internal which suggests it is not a public library. We may need to create google_cloud_cpp_auth ?

@coryan coryan added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Jun 20, 2023
@coryan coryan self-assigned this Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant