top

Package auth implements an opinionated wrapper around OAuth2.

It hides configurability of base oauth2 library and instead makes a predefined set of choices regarding where the credentials should be stored, how they should be cached and how OAuth2 flow should be invoked.

It makes authentication flows look more uniform across tools that use this package and allow credentials reuse across multiple binaries.

Also it knows about various environments luci tools are running under (GCE, regular datacenter, GAE, developers' machines) and switches default authentication scheme accordingly (e.g. on GCE machine the default is to use GCE metadata server).

All tools that use auth library share same credentials by default, meaning a user needs to authenticate only once to use them all. Credentials are cached in ~/.config/chrome_infra/auth/*.tok and may be reused by all processes running under the same user account.

Imports 11 package(s)

  1. github.com/mitchellh/go-homedir
  2. golang.org/x/oauth2
  3. github.com/luci/luci-go/common/errors
  4. github.com/luci/luci-go/common/logging
  5. github.com/luci/luci-go/common/retry
  6. golang.org/x/net/context
  7. golang.org/x/net/context/ctxhttp
  8. cloud.google.com/go/compute/metadata
  9. github.com/luci/luci-go/common/clock
  10. google.golang.org/grpc/credentials
  11. github.com/luci/luci-go/common/auth/internal

Test imports 3 package(s)

  1. github.com/smartystreets/goconvey/convey
  2. github.com/luci/luci-go/common/clock/testclock
  3. github.com/luci/luci-go/common/testing/assertions