Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

tool to expand scope or set of scopes #278

Open
jonasfj opened this issue Aug 12, 2017 · 15 comments
Open

tool to expand scope or set of scopes #278

jonasfj opened this issue Aug 12, 2017 · 15 comments

Comments

@jonasfj
Copy link
Contributor

jonasfj commented Aug 12, 2017

Say I have a role like: assume:repo:github.com/glandium/git-cinnabar:branch:master and I want to know what scopes it gets... I need to call auth.expandScopes it would be nice to have a tool for this...

Note: assume:repo:github.com/glandium/git-cinnabar:branch:<branch> is basically a pattern made up by tc-gh...

@jonasfj
Copy link
Contributor Author

jonasfj commented Aug 12, 2017

This is just a nice-to-have quick hack.. Nothing important :)

@djmitche
Copy link
Contributor

The pattern is actually documented as a Taskcluster convention in the namespaces document, and is also supported by mozilla-taskcluster.

@jonasfj
Copy link
Contributor Author

jonasfj commented Aug 15, 2017

I probably have no excuse for being too lazy to lookup the right docs...

But yes, namespaces document is where I should look.. still it's nice to be able to expand scopes.

@djmitche
Copy link
Contributor

Yes, I was only disagreeing with your second paragraph. I agree with the first :)

@Biboswan
Copy link
Contributor

Can I work on this.

@djmitche
Copy link
Contributor

Yes! I think this would be an additional view which can take a list of scopes and expand it.

@Biboswan
Copy link
Contributor

I 'm trying await this.props.auth.expandScopes({ scopes: this.state.scopes }) where scopes is an array

Getting error:

TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.
    at s (VM42094 290:2)
    at setTimeout (VM42094 290:2

https://docs.taskcluster.net/reference/platform/taskcluster-auth/references/api#expand-scopes

@djmitche
Copy link
Contributor

Uh, wow. So that API call isn't valid HTTP. That was really stupid of me.

@djmitche
Copy link
Contributor

So it sounds like you're on the right track! Once the change linked above lands, we'll need to upgrade taskcluster-client-web in tools, and then the call you're making should work properly.

@Biboswan
Copy link
Contributor

I see only taskcluster-client-web/src/clients/Auth.js needs an update.

@Biboswan
Copy link
Contributor

Anything else?

@djmitche
Copy link
Contributor

https://github.com/taskcluster/taskcluster-client-web#updating-built-in-apis shows how to update the client and make a PR. I'll try to get to that today, but if you beat me to it and make a PR that's great too :)

@djmitche
Copy link
Contributor

djmitche commented Jan 31, 2018 via email

@eliperelman
Copy link
Contributor

You can shorten that to yarn add taskcluster-client-web.

@Biboswan
Copy link
Contributor

Now I'm getting expandScopes response successfully.:)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants