From cbbc5061280d2fcd107593ac8f98f8431649172c Mon Sep 17 00:00:00 2001 From: Patrick Jones Date: Thu, 17 Jun 2021 11:06:20 -0700 Subject: [PATCH] downscope: fixing nits and renaming --- google/downscope/downscoping_test.go | 2 +- google/downscope/example_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/google/downscope/downscoping_test.go b/google/downscope/downscoping_test.go index eb5bbca..fe59ce3 100644 --- a/google/downscope/downscoping_test.go +++ b/google/downscope/downscoping_test.go @@ -39,7 +39,7 @@ func Test_DownscopedTokenSource(t *testing.T) { })) new := []AccessBoundaryRule{ - AccessBoundaryRule{ + { AvailableResource: "test1", AvailablePermissions: []string{"Perm1", "Perm2"}, }, diff --git a/google/downscope/example_test.go b/google/downscope/example_test.go index ed2e317..4112234 100644 --- a/google/downscope/example_test.go +++ b/google/downscope/example_test.go @@ -41,8 +41,8 @@ type localTokenSource struct { } func (lts localTokenSource) Token() (*oauth2.Token, error) { - // Make a call to a remote token broker, which runs downscope.NewTokenSource - // to generate a downscoped version of a token it holds. Return + // Make a call to a remote token broker, which runs downscope.NewTokenSource() + // to generate a downscoped version of a token it holds. Returns said token. var tok oauth2.Token return &tok, nil } @@ -50,7 +50,7 @@ func (lts localTokenSource) Token() (*oauth2.Token, error) { // ExampleRefreshableToken provices a sample of how a token consumer would // construct a refreshable token by wrapping a method that requests a // downscoped token from a token broker in an oauth2.ReuseTokenSource -func ExampleRefreshableToken() { +func ExampleNewTokenSource_refresh() { var myCredentials oauth2.TokenSource // This Source contains the credentials that the token consumer uses to // authenticate itself to the token broker from which it is requesting