GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Move read-only methods of 'Scoped' into new interface, 'ReadOnlyScoped'. by tseaver · Pull Request #195 · googleapis/google-auth-library-python

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@tseaver

@tseaver tseaver commented Sep 11, 2017

Copy link
Copy Markdown
Contributor

Not all subclasses of 'Scoped' can sanely implement with_scopes (e.g, on GCE the scopes are hard-wired in when creating the GCE node).

Make Scoped derive from ReadOnlyScoped, adding the with_scopes method.

Make GCE's Credentials class derive from ReadOnlyScoped.

Closes #194.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tseaver
Move read-only methods of 'Scoped' into new interface, 'ReadOnlyScoped'.
21b6e50
Not all subclasses of 'Scoped' can sanely implement 'with_scopes' (e.g, on
GCE the scopes are hard-wired in when creating the GCE node).

Make 'Scoped' derive from 'ReadOnlyScoped', adding the 'with_scopes' method.

Make GCE's 'credentials' class derive from 'ReadOnlyScoped'.

Closes #194.
@tseaver

tseaver commented Sep 11, 2017

Copy link
Copy Markdown
Contributor Author

@jonparrott PTAL.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver tseaver mentioned this pull request Sep 11, 2017
Cannot create a spanner session when running in compute engine googleapis/google-cloud-python#3933
Closed
@theacodes
theacodes requested a review from dhermes September 11, 2017 16:03
theacodes
theacodes approved these changes Sep 11, 2017
View reviewed changes
@theacodes

theacodes commented Sep 11, 2017

Copy link
Copy Markdown
Contributor

This seems pretty reasonable to me, but I'd like @dhermes to take a quick look as well.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dhermes
dhermes reviewed Sep 11, 2017
View reviewed changes

@dhermes dhermes left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't see any issue with the code here, but I'm scratching my head a bit about why this is needed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@theacodes

theacodes commented Sep 11, 2017

Copy link
Copy Markdown
Contributor

@tseaver I want to double check something - this does not break the current interface of the library, correct? Other than GCE credentials now being "scopeless"?

but I'm scratching my head a bit about why this is needed.

Yeah - could we get some context? I understand the computer sciency parts, but in practice how does this make the calling code different?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lukesneeringer
lukesneeringer suggested changes Sep 11, 2017
View reviewed changes

@lukesneeringer lukesneeringer left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It is a wee nitpicky, but since it is a public interface, can we do ReadOnlyScoped and not ReadonlyScoped? (Capitalized O)

If there are no objections, I will make the edit myself out of respect for others' time.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lukesneeringer

lukesneeringer commented Sep 11, 2017

Copy link
Copy Markdown

Yeah - could we get some context? I understand the computer sciency parts, but in practice how does this make the calling code different?

Context: googleapis/google-cloud-python#3933

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented Sep 11, 2017

Copy link
Copy Markdown
Contributor Author

Context: Having GCE's credentials derive from Scoped is a promise that it has a meaningful with_scopes, but in fact it raises NotImplementedError, which means that clients can't rely on it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes

theacodes commented Sep 11, 2017

Copy link
Copy Markdown
Contributor

If there are no objections, I will make the edit myself out of respect for others' time.

go for it

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver
s/Readonly/ReadOnly/
07d9c3b
Addresses:
#195 (review)
@tseaver

tseaver commented Sep 11, 2017

Copy link
Copy Markdown
Contributor Author

@lukesneeringer 07d9c3b updates spelling per your request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lukesneeringer

lukesneeringer commented Sep 11, 2017

Copy link
Copy Markdown

You beat me to it. Thanks. :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lukesneeringer
lukesneeringer approved these changes Sep 11, 2017
View reviewed changes
@theacodes
theacodes merged commit 4246832 into googleapis:master Sep 11, 2017
@tseaver
tseaver deleted the 194-gce-not-scoped branch September 11, 2017 20:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

3 more reviewers
@dhermes dhermes dhermes left review comments
@lukesneeringer lukesneeringer lukesneeringer approved these changes
@theacodes theacodes theacodes approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@tseaver @theacodes @lukesneeringer @dhermes
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.