Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat(idp): add OIDC identity provider implementation (#4357)

Joe Chen35c82b89db3f
diff --git a/backend/plugin/idp/CODENOTIFY b/backend/plugin/idp/CODENOTIFY
new file mode 100644
index 0000000000..b58720ac88
--- /dev/null
+++ b/backend/plugin/idp/CODENOTIFY
@@ -0,0 +1,3 @@
+# See https://github.com/sourcegraph/codenotify for documentation.
+
+**/* @unknwon
diff --git a/backend/plugin/idp/oidc/oidc.go b/backend/plugin/idp/oidc/oidc.go
new file mode 100644
index 0000000000..a09f7789d2
--- /dev/null
+++ b/backend/plugin/idp/oidc/oidc.go
@@ -0,0 +1,126 @@
+// Package oidc is the plugin for OIDC Identity Provider.
+package oidc
+
+import (
+ "context"
+
+ "github.com/coreos/go-oidc"
+ "github.com/pkg/errors"
+ "golang.org/x/oauth2"
+
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
+)
+
+// IdentityProvider represents an OIDC Identity Provider.
+type IdentityProvider struct {
+ provider *oidc.Provider
+ config IdentityProviderConfig
+}
+
+// IdentityProviderConfig is the configuration to be consumed by the OIDC
+// Identity Provider.
+type IdentityProviderConfig struct {
+ Issuer string `json:"issuer"`
+ ClientID string `json:"clientId"`
+ ClientSecret string `json:"clientSecret"`
+ FieldMapping *storepb.FieldMapping `json:"fieldMapping"`
+}
+
+// NewIdentityProvider initializes a new OIDC Identity Provider with the given
+// configuration.
+func NewIdentityProvider(ctx context.Context, config IdentityProviderConfig) (*IdentityProvider, error) {
+ for v, field := range map[string]string{
+ config.Issuer: "issuer",
+ config.ClientID: "clientId",
+ config.ClientSecret: "clientSecret",
+ config.FieldMapping.Identifier: "fieldMapping.identifier",
+ } {
+ if v == "" {
+ return nil, errors.Errorf("the field %q is empty but required", field)
+ }
+ }
+
+ p, err := oidc.NewProvider(ctx, config.Issuer)
+ if err != nil {
+ return nil, errors.Wrap(err, "create new provider")
+ }
+ return &IdentityProvider{
+ provider: p,
+ config: config,
+ }, nil
+}
+
+// ExchangeToken returns the exchanged OAuth2 token using the given redirect
+// URL and authorization code.
+func (p *IdentityProvider) ExchangeToken(ctx context.Context, redirectURL, code string) (*oauth2.Token, error) {
+ oauth2Config := oauth2.Config{
+ ClientID: p.config.ClientID,
+ ClientSecret: p.config.ClientSecret,
+ RedirectURL: redirectURL,
+
+ // Discovery returns the OAuth2 endpoints.
+ Endpoint: p.provider.Endpoint(),
+
+ // "openid" is a required scope for OpenID Connect flows.
+ Scopes: []string{oidc.ScopeOpenID, "profile", "email"},
+ }
+ token, err := oauth2Config.Exchange(ctx, code)
+ if err != nil {
+ return nil, errors.Wrap(err, "exchange token")
+ }
+ return token, nil
+}
+
+// UserInfo returns the parsed user information using the given OAuth2 token.
+// The nonce is used for request validation, which should be the same value as
+// it was sent to the issuer as part of the Authentication Request, see
+// https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest.
+func (p *IdentityProvider) UserInfo(ctx context.Context, token *oauth2.Token, nonce string) (*storepb.IdentityProviderUserInfo, error) {
+ // Extract the ID Token from the access token, see http://openid.net/specs/openid-connect-core-1_0.html#TokenResponse.
+ rawIDToken, ok := token.Extra("id_token").(string)
+ if !ok {
+ return nil, errors.New(`missing "id_token" from the issuer's authorization response`)
+ }
+
+ verifier := p.provider.Verifier(&oidc.Config{ClientID: p.config.ClientID})
+ idToken, err := verifier.Verify(ctx, rawIDToken)
+ if err != nil {
+ return nil, errors.Wrap(err, "verify raw ID Token")
+ }
+
+ if idToken.Nonce != nonce {
+ return nil, errors.Errorf("mismatched nonce")
+ }
+
+ rawUserInfo, err := p.provider.UserInfo(ctx, oauth2.StaticTokenSource(token))
+ if err != nil {
+ return nil, errors.Wrap(err, "fetch user info")
+ }
+
+ var claims map[string]any
+ err = rawUserInfo.Claims(&claims)
+ if err != nil {
+ return nil, errors.Wrap(err, "unmarshal claims")
+ }
+
+ userInfo := &storepb.IdentityProviderUserInfo{}
+ if v, ok := claims[p.config.FieldMapping.Identifier].(string); ok {
+ userInfo.Identifier = v
+ }
+ if userInfo.Identifier == "" {
+ return nil, errors.Errorf("the field %q is not found in claims or has empty value", p.config.FieldMapping.Identifier)
+ }
+
+ // Best effort to map optional fields
+ if p.config.FieldMapping.DisplayName != "" {
+ if v, ok := claims[p.config.FieldMapping.DisplayName].(string); ok {
+ userInfo.DisplayName = v
+ }
+ }
+ if p.config.FieldMapping.Email != "" {
+ if v, ok := claims[p.config.FieldMapping.Email].(string); ok {
+ userInfo.Email = v
+ }
+ }
+ return userInfo, nil
+}
diff --git a/backend/plugin/idp/oidc/oidc_test.go b/backend/plugin/idp/oidc/oidc_test.go
new file mode 100644
index 0000000000..6d9f816fa5
--- /dev/null
+++ b/backend/plugin/idp/oidc/oidc_test.go
@@ -0,0 +1,223 @@
+package oidc
+
+import (
+ "context"
+ "crypto/rand"
+ "crypto/rsa"
+ "encoding/json"
+ "io"
+ "net/http"
+ "net/http/httptest"
+ "net/url"
+ "testing"
+ "time"
+
+ "github.com/golang-jwt/jwt/v4"
+ "github.com/lestrrat-go/jwx/v2/jwk"
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
+)
+
+func TestNewIdentityProvider(t *testing.T) {
+ ctx := context.Background()
+ tests := []struct {
+ name string
+ config IdentityProviderConfig
+ containsErr string
+ }{
+ {
+ name: "no issuer",
+ config: IdentityProviderConfig{
+ Issuer: "",
+ ClientID: "test-client-id",
+ ClientSecret: "test-client-secret",
+ FieldMapping: &storepb.FieldMapping{
+ Identifier: "sub",
+ },
+ },
+ containsErr: `the field "issuer" is empty but required`,
+ },
+ {
+ name: "no clientId",
+ config: IdentityProviderConfig{
+ Issuer: "https://oidc.example.com",
+ ClientID: "",
+ ClientSecret: "test-client-secret",
+ FieldMapping: &storepb.FieldMapping{
+ Identifier: "sub",
+ },
+ },
+ containsErr: `the field "clientId" is empty but required`,
+ },
+ {
+ name: "no clientSecret",
+ config: IdentityProviderConfig{
+ Issuer: "https://oidc.example.com",
+ ClientID: "test-client-id",
+ ClientSecret: "",
+ FieldMapping: &storepb.FieldMapping{
+ Identifier: "sub",
+ },
+ },
+ containsErr: `the field "clientSecret" is empty but required`,
+ },
+ {
+ name: "no fieldMapping.identifier",
+ config: IdentityProviderConfig{
+ Issuer: "https://oidc.example.com",
+ ClientID: "test-client-id",
+ ClientSecret: "test-client-secret",
+ FieldMapping: &storepb.FieldMapping{
+ DisplayName: "name",
+ },
+ },
+ containsErr: `the field "fieldMapping.identifier" is empty but required`,
+ },
+ }
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ _, err := NewIdentityProvider(ctx, test.config)
+ assert.ErrorContains(t, err, test.containsErr)
+ })
+ }
+}
+
+func newMockServer(t *testing.T, clientID, code, accessToken, nonce string, userinfo []byte) *httptest.Server {
+ mux := http.NewServeMux()
+
+ var openidConfig map[string]any
+ mux.HandleFunc("/.well-known/openid-configuration", func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "application/json")
+ err := json.NewEncoder(w).Encode(openidConfig)
+ require.NoError(t, err)
+ })
+
+ var rawIDToken string
+ mux.HandleFunc("/oauth2/token", func(w http.ResponseWriter, r *http.Request) {
+ require.Equal(t, http.MethodPost, r.Method)
+
+ body, err := io.ReadAll(r.Body)
+ require.NoError(t, err)
+ vals, err := url.ParseQuery(string(body))
+ require.NoError(t, err)
+
+ require.Equal(t, code, vals.Get("code"))
+ require.Equal(t, "authorization_code", vals.Get("grant_type"))
+ require.Equal(t, "https://example.com/oidc/callback", vals.Get("redirect_uri"))
+
+ w.Header().Set("Content-Type", "application/json")
+ err = json.NewEncoder(w).Encode(map[string]any{
+ "access_token": accessToken,
+ "token_type": "Bearer",
+ "refresh_token": "test-refresh-token",
+ "expires_in": 3600,
+ "id_token": rawIDToken,
+ })
+ require.NoError(t, err)
+ })
+ mux.HandleFunc("/oauth2/userinfo", func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "application/json")
+ _, err := w.Write(userinfo)
+ require.NoError(t, err)
+ })
+
+ rs256, err := rsa.GenerateKey(rand.Reader, 2048)
+ require.NoError(t, err)
+ mux.HandleFunc("/oauth/discovery/keys", func(w http.ResponseWriter, r *http.Request) {
+ key, err := jwk.FromRaw(rs256.PublicKey)
+ require.NoError(t, err)
+
+ err = key.Set(jwk.KeyUsageKey, "sig")
+ require.NoError(t, err)
+ err = key.Set(jwk.AlgorithmKey, "RS256")
+ require.NoError(t, err)
+ marshalledKey, err := json.Marshal(key)
+ require.NoError(t, err)
+
+ w.Header().Set("Content-Type", "application/json")
+ err = json.NewEncoder(w).Encode(map[string]any{
+ "keys": []json.RawMessage{marshalledKey},
+ })
+ require.NoError(t, err)
+ })
+
+ s := httptest.NewServer(mux)
+
+ openidConfig = map[string]any{
+ "issuer": s.URL,
+ "authorization_endpoint": s.URL + "/oauth2/authorize",
+ "token_endpoint": s.URL + "/oauth2/token",
+ "userinfo_endpoint": s.URL + "/oauth2/userinfo",
+ "jwks_uri": s.URL + "/oauth/discovery/keys",
+ "id_token_signing_alg_values_supported": []string{"RS256"},
+ }
+
+ token := jwt.NewWithClaims(
+ jwt.SigningMethodRS256,
+ jwt.MapClaims{
+ "iss": s.URL,
+ "sub": "123456789",
+ "aud": clientID,
+ "exp": time.Now().Add(time.Hour).Unix(),
+ "iat": time.Now().Unix(),
+ "nonce": nonce,
+ },
+ )
+ rawIDToken, err = token.SignedString(rs256)
+ require.NoError(t, err)
+ return s
+}
+
+func TestIdentityProvider(t *testing.T) {
+ ctx := context.Background()
+
+ const (
+ testClientID = "test-client-id"
+ testNonce = "test-nonce"
+ testCode = "test-code"
+ testAccessToken = "test-access-token"
+ testSubject = "123456789"
+ testName = "John Doe"
+ testEmail = "[email protected]"
+ )
+ userinfo, err := json.Marshal(
+ map[string]any{
+ "sub": testSubject,
+ "name": testName,
+ "email": testEmail,
+ },
+ )
+ require.NoError(t, err)
+
+ s := newMockServer(t, testClientID, testCode, testAccessToken, testNonce, userinfo)
+ oidc, err := NewIdentityProvider(
+ ctx,
+ IdentityProviderConfig{
+ Issuer: s.URL,
+ ClientID: testClientID,
+ ClientSecret: "test-client-secret",
+ FieldMapping: &storepb.FieldMapping{
+ Identifier: "sub",
+ DisplayName: "name",
+ Email: "email",
+ },
+ },
+ )
+ require.NoError(t, err)
+
+ oauthToken, err := oidc.ExchangeToken(ctx, "https://example.com/oidc/callback", testCode)
+ require.NoError(t, err)
+ require.Equal(t, testAccessToken, oauthToken.AccessToken)
+
+ userInfo, err := oidc.UserInfo(ctx, oauthToken, testNonce)
+ require.NoError(t, err)
+
+ wantUserInfo := &storepb.IdentityProviderUserInfo{
+ Identifier: testSubject,
+ DisplayName: testName,
+ Email: testEmail,
+ }
+ assert.Equal(t, wantUserInfo, userInfo)
+}
diff --git a/backend/store/idp.go b/backend/store/idp.go
index f697bde92e..828423b3ef 100644
--- a/backend/store/idp.go
+++ b/backend/store/idp.go
@@ -14,7 +14,7 @@ import (
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
-// IdentityProviderMessage is the mssage for identity provider.
+// IdentityProviderMessage is the message for identity provider.
type IdentityProviderMessage struct {
ResourceID string
Title string
diff --git a/go.mod b/go.mod
index 07ca59754e..e116952c67 100644
--- a/go.mod
+++ b/go.mod
@@ -13,6 +13,7 @@ require (
github.com/blang/semver/v4 v4.0.0
github.com/casbin/casbin/v2 v2.56.0
github.com/cenkalti/backoff/v4 v4.2.0
+ github.com/coreos/go-oidc v2.2.1+incompatible
github.com/github/gh-ost v1.1.5
github.com/go-sql-driver/mysql v1.6.0
github.com/golang-jwt/jwt/v4 v4.4.2
@@ -26,6 +27,7 @@ require (
github.com/jackc/pgx/v5 v5.1.1
github.com/labstack/echo-contrib v0.13.0
github.com/labstack/echo/v4 v4.9.1
+ github.com/lestrrat-go/jwx/v2 v2.0.8
github.com/lib/pq v1.10.2
github.com/mattn/go-sqlite3 v1.14.16
github.com/paulmach/orb v0.8.0
@@ -96,6 +98,7 @@ require (
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
github.com/danjacques/gofslock v0.0.0-20220131014315-6e321f4509c8 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect
@@ -110,6 +113,7 @@ require (
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/spec v0.20.7 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/goccy/go-json v0.9.11 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@@ -130,6 +134,11 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.15.13 // indirect
github.com/labstack/gommon v0.4.0 // indirect
+ github.com/lestrrat-go/blackmagic v1.0.1 // indirect
+ github.com/lestrrat-go/httpcc v1.0.1 // indirect
+ github.com/lestrrat-go/httprc v1.0.4 // indirect
+ github.com/lestrrat-go/iter v1.0.2 // indirect
+ github.com/lestrrat-go/option v1.0.0 // indirect
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
@@ -149,6 +158,7 @@ require (
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
+ github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
@@ -187,6 +197,7 @@ require (
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
+ gopkg.in/square/go-jose.v2 v2.6.0 // indirect
nhooyr.io/websocket v1.8.6 // indirect
)
diff --git a/go.sum b/go.sum
index ea7e46f815..6259ace5d4 100644
--- a/go.sum
+++ b/go.sum
@@ -205,6 +205,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE
github.com/coocood/bbloom v0.0.0-20190830030839-58deb6228d64 h1:W1SHiII3e0jVwvaQFglwu3kS9NLxOeTpvik7MbKCyuQ=
github.com/coocood/freecache v1.2.1 h1:/v1CqMq45NFH9mp/Pt142reundeBM0dVUD3osQBeu/U=
github.com/coocood/rtutil v0.0.0-20190304133409-c84515f646f2 h1:NnLfQ77q0G4k2Of2c1ceQ0ec6MkLQyDp+IGdVM0D8XM=
+github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk=
+github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
@@ -229,6 +231,9 @@ github.com/danjacques/gofslock v0.0.0-20220131014315-6e321f4509c8/go.mod h1:VT5E
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
+github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4=
+github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc=
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I=
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE=
github.com/dgraph-io/ristretto v0.1.1-0.20220403145359-8e850b710d6d h1:Wrc3UKTS+cffkOx0xRGFC+ZesNuTfn0ThvEC72N0krk=
@@ -329,6 +334,8 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
+github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk=
+github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -584,6 +591,18 @@ github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
+github.com/lestrrat-go/blackmagic v1.0.1 h1:lS5Zts+5HIC/8og6cGHb0uCcNCa3OUt1ygh3Qz2Fe80=
+github.com/lestrrat-go/blackmagic v1.0.1/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU=
+github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=
+github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E=
+github.com/lestrrat-go/httprc v1.0.4 h1:bAZymwoZQb+Oq8MEbyipag7iSq6YIga8Wj6GOiJGdI8=
+github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo=
+github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI=
+github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4=
+github.com/lestrrat-go/jwx/v2 v2.0.8 h1:jCFT8oc0hEDVjgUgsBy1F9cbjsjAVZSXNi7JaU9HR/Q=
+github.com/lestrrat-go/jwx/v2 v2.0.8/go.mod h1:zLxnyv9rTlEvOUHbc48FAfIL8iYu2hHvIRaTFGc8mT0=
+github.com/lestrrat-go/option v1.0.0 h1:WqAWL8kh8VcSoD6xjSH34/1m8yxluXQbDeKNfvFeEO4=
+github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
@@ -734,6 +753,8 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI=
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
+github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8cTqKc=
+github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
@@ -981,6 +1002,7 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
@@ -1405,6 +1427,8 @@ gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:a
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI=
+gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=