diff options
| author | Greg Steuck <gnezdo@google.com> | 2021-07-28 15:34:03 -0700 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2021-07-30 18:21:17 +0200 |
| commit | 6c236867ce33c0c16b102e02a08226d7eb9b2046 (patch) | |
| tree | be81602e5bbe634e223bdc2bfc97049dd7f8a57e /pkg | |
| parent | 75047cf943db20755af0bf9ce3af5502b4040b70 (diff) | |
syz-manager: support oauth when calling syz-hub
Permit empty hub_key to indicate oauth.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/auth/jwt.go | 5 | ||||
| -rw-r--r-- | pkg/mgrconfig/load.go | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/auth/jwt.go b/pkg/auth/jwt.go index 3e2313d11..f6d219323 100644 --- a/pkg/auth/jwt.go +++ b/pkg/auth/jwt.go @@ -101,7 +101,8 @@ func MakeCache(ctor func(method, url string, body io.Reader) (*http.Request, err // Get returns a potentially cached value of the token or renews as // necessary. The now parameter provides the current time for cache -// expiration. +// expiration. The returned value is suitable for Authorization header +// and syz-hub Key requests. func (cache *TokenCache) Get(now time.Time) (string, error) { cache.lock.Lock() defer cache.lock.Unlock() @@ -118,5 +119,5 @@ func (cache *TokenCache) Get(now time.Time) (string, error) { } cache.token = t } - return cache.token.value, nil + return "Bearer " + cache.token.value, nil } diff --git a/pkg/mgrconfig/load.go b/pkg/mgrconfig/load.go index b16e72540..f26b26124 100644 --- a/pkg/mgrconfig/load.go +++ b/pkg/mgrconfig/load.go @@ -151,7 +151,6 @@ func Complete(cfg *Config) error { if err := checkNonEmpty( cfg.Name, "name", cfg.HubAddr, "hub_addr", - cfg.HubKey, "hub_key", ); err != nil { return err } |
