| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Package auth implements an opinionated wrapper around OAuth2. | 5 // Package auth implements an opinionated wrapper around OAuth2. |
| 6 // | 6 // |
| 7 // It hides configurability of base oauth2 library and instead makes a | 7 // It hides configurability of base oauth2 library and instead makes a |
| 8 // predefined set of choices regarding where the credentials should be stored, | 8 // predefined set of choices regarding where the credentials should be stored, |
| 9 // how they should be cached and how OAuth2 flow should be invoked. | 9 // how they should be cached and how OAuth2 flow should be invoked. |
| 10 // | 10 // |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 "net/http" | 31 "net/http" |
| 32 "os" | 32 "os" |
| 33 "path/filepath" | 33 "path/filepath" |
| 34 "sort" | 34 "sort" |
| 35 "sync" | 35 "sync" |
| 36 "time" | 36 "time" |
| 37 | 37 |
| 38 "golang.org/x/net/context" | 38 "golang.org/x/net/context" |
| 39 "golang.org/x/oauth2" | 39 "golang.org/x/oauth2" |
| 40 | 40 |
| 41 » "google.golang.org/cloud/compute/metadata" | 41 » "cloud.google.com/go/compute/metadata" |
| 42 | 42 |
| 43 "github.com/mitchellh/go-homedir" | 43 "github.com/mitchellh/go-homedir" |
| 44 | 44 |
| 45 "github.com/luci/luci-go/common/auth/internal" | 45 "github.com/luci/luci-go/common/auth/internal" |
| 46 "github.com/luci/luci-go/common/clock" | 46 "github.com/luci/luci-go/common/clock" |
| 47 "github.com/luci/luci-go/common/logging" | 47 "github.com/luci/luci-go/common/logging" |
| 48 "github.com/luci/luci-go/common/retry" | 48 "github.com/luci/luci-go/common/retry" |
| 49 ) | 49 ) |
| 50 | 50 |
| 51 var ( | 51 var ( |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 } | 832 } |
| 833 | 833 |
| 834 // SecretsDir returns an absolute path to a directory to keep secret files in. | 834 // SecretsDir returns an absolute path to a directory to keep secret files in. |
| 835 func SecretsDir() string { | 835 func SecretsDir() string { |
| 836 home, err := homedir.Dir() | 836 home, err := homedir.Dir() |
| 837 if err != nil { | 837 if err != nil { |
| 838 panic(err.Error()) | 838 panic(err.Error()) |
| 839 } | 839 } |
| 840 return filepath.Join(home, ".config", "chrome_infra", "auth") | 840 return filepath.Join(home, ".config", "chrome_infra", "auth") |
| 841 } | 841 } |
| OLD | NEW |