downscope: fixing nits and renaming

This commit is contained in:
Patrick Jones 2021-06-17 11:06:20 -07:00
parent b594a6032e
commit cbbc506128
2 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ func Test_DownscopedTokenSource(t *testing.T) {
})) }))
new := []AccessBoundaryRule{ new := []AccessBoundaryRule{
AccessBoundaryRule{ {
AvailableResource: "test1", AvailableResource: "test1",
AvailablePermissions: []string{"Perm1", "Perm2"}, AvailablePermissions: []string{"Perm1", "Perm2"},
}, },

View File

@ -41,8 +41,8 @@ type localTokenSource struct {
} }
func (lts localTokenSource) Token() (*oauth2.Token, error) { func (lts localTokenSource) Token() (*oauth2.Token, error) {
// Make a call to a remote token broker, which runs downscope.NewTokenSource // Make a call to a remote token broker, which runs downscope.NewTokenSource()
// to generate a downscoped version of a token it holds. Return // to generate a downscoped version of a token it holds. Returns said token.
var tok oauth2.Token var tok oauth2.Token
return &tok, nil return &tok, nil
} }
@ -50,7 +50,7 @@ func (lts localTokenSource) Token() (*oauth2.Token, error) {
// ExampleRefreshableToken provices a sample of how a token consumer would // ExampleRefreshableToken provices a sample of how a token consumer would
// construct a refreshable token by wrapping a method that requests a // construct a refreshable token by wrapping a method that requests a
// downscoped token from a token broker in an oauth2.ReuseTokenSource // downscoped token from a token broker in an oauth2.ReuseTokenSource
func ExampleRefreshableToken() { func ExampleNewTokenSource_refresh() {
var myCredentials oauth2.TokenSource var myCredentials oauth2.TokenSource
// This Source contains the credentials that the token consumer uses to // This Source contains the credentials that the token consumer uses to
// authenticate itself to the token broker from which it is requesting // authenticate itself to the token broker from which it is requesting