downscope: move validation checks

This commit is contained in:
Patrick Jones
2021-06-24 16:24:14 -07:00
parent fec7137f21
commit 941cf10a8e
2 changed files with 23 additions and 21 deletions

View File

@@ -27,8 +27,10 @@ func ExampleNewTokenSource() {
// rootSource, err := google.DefaultTokenSource(ctx, "https://www.googleapis.com/auth/cloud-platform")
dts := downscope.NewTokenSource(ctx, downscope.DownscopingConfig{RootSource: rootSource, Rules: accessBoundary})
_ = dts
dts, err := downscope.NewTokenSource(ctx, downscope.DownscopingConfig{RootSource: rootSource, Rules: accessBoundary})
if err != nil {
_ = dts
}
// You can now use the token held in myTokenSource to make
// Google Cloud Storage calls, as follows: