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

Is there a way to stub authenticators? #181

Open
emarcotte opened this issue Jul 17, 2022 · 3 comments
Open

Is there a way to stub authenticators? #181

emarcotte opened this issue Jul 17, 2022 · 3 comments

Comments

@emarcotte
Copy link

I've been poking around trying to write a local emulator testing scheme for some code against the firestore and pubsub emulators. As others have seen in google-apis-rs (Byron/google-apis-rs#313) authenticators are a required part of the structure.

From what I can see

pub enum AuthFlow {
DeviceFlow(DeviceFlow),
InstalledFlow(InstalledFlow),
#[cfg(feature = "service_account")]
ServiceAccountFlow(ServiceAccountFlow),
ApplicationDefaultCredentialsFlow(ApplicationDefaultCredentialsFlow),
AuthorizedUserFlow(AuthorizedUserFlow),
has a fixed set of authentication flows and no trait that I could implement and allow for some sort of "EmptyAuthFlow" to be passed in.

Is there any mechanism I'm missing where I could pass an authentication flow that doesn't actually request anything from a server or is it something where upstream should be allowing a "no authentication" flow and bypassing yup-oauth?

@dermesser
Copy link
Owner

dermesser commented Jul 17, 2022 via email

@emarcotte
Copy link
Author

The first part being a trait that would be part of google-apis-rs replacing its direct usage of the Authenticator struct you mean? To be honest having that trait in either place (google-apis-rs or yup-oauth2) seems reasonable to me. Just wasn't sure if there was a "native" way to do this already.

I'll fool around with this some and see where I land.

@dermesser
Copy link
Owner

dermesser commented Jul 18, 2022 via email

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

No branches or pull requests

2 participants