diff --git a/Dockerfile b/Dockerfile index adbb3b830c..83566b0b99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ ARG GOPROXY COPY go.mod go.sum ./ COPY api/v2/go.mod api/v2/go.sum ./api/v2/ +COPY connector/external/sdk/go.mod connector/external/sdk/go.sum ./connector/external/sdk/ RUN go mod download COPY . . @@ -52,6 +53,7 @@ RUN chown -R 1001:1001 /etc/dex # Copy module files for CVE scanning / dependency analysis. COPY --from=builder /usr/local/src/dex/go.mod /usr/local/src/dex/go.sum /usr/local/src/dex/ COPY --from=builder /usr/local/src/dex/api/v2/go.mod /usr/local/src/dex/api/v2/go.sum /usr/local/src/dex/api/v2/ +COPY --from=builder /usr/local/src/dex/connector/external/sdk/go.mod /usr/local/src/dex/connector/external/sdk//go.sum /usr/local/src/dex/connector/external/sdk/ COPY --from=builder /go/bin/dex /usr/local/bin/dex COPY --from=builder /usr/local/src/dex/web /srv/dex/web diff --git a/Makefile b/Makefile index b92aee98ca..7c01201df3 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ bin/dex: @mkdir -p bin/ @go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/dex -examples: bin/grpc-client bin/example-app +examples: bin/grpc-client bin/example-app bin/external-connector bin/external-gitlab bin/grpc-client: @mkdir -p bin/ @@ -45,6 +45,14 @@ bin/example-app: @mkdir -p bin/ @cd examples/ && go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/examples/example-app +bin/external-connector: + @mkdir -p bin/ + @cd examples/ && go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/examples/external-connector + +bin/external-gitlab: + @mkdir -p bin/ + @cd examples/ && go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/examples/external-gitlab + .PHONY: release-binary release-binary: generate @go build -o /go/bin/dex -v -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/dex @@ -108,6 +116,7 @@ FORCE: proto: @protoc --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. api/v2/*.proto @protoc --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. api/*.proto + @protoc --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. connector/external/sdk/*.proto #@cp api/v2/*.proto api/ .PHONY: proto-internal diff --git a/connector/external/callback.go b/connector/external/callback.go new file mode 100644 index 0000000000..1b37f7e3f0 --- /dev/null +++ b/connector/external/callback.go @@ -0,0 +1,87 @@ +package external + +import ( + "context" + "fmt" + "io" + "net/http" + + "github.com/dexidp/dex/connector" + "github.com/dexidp/dex/connector/external/sdk" + "github.com/dexidp/dex/pkg/log" +) + +type CallbackConnectorConfig struct { + gRPCConnectorConfig + + id string + logger log.Logger + + client sdk.CallbackConnectorClient +} + +func (c *CallbackConnectorConfig) Open(id string, logger log.Logger) (connector.Connector, error) { + conn, err := grpcConn(c.Port, c.CAPath, c.ClientCrt, c.ClientKey) + if err != nil { + return connector.Identity{}, err + } + + c.id = id + c.client = sdk.NewCallbackConnectorClient(conn) + c.logger = logger + return c, nil +} + +func (c *CallbackConnectorConfig) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) { + response, err := c.client.LoginURL(context.Background(), &sdk.LoginURLReq{ + Scopes: toSDKScopes(scopes), CallbackUrl: callbackURL, State: state, + }) + if err != nil { + return "", err + } + + return response.Url, nil +} + +func (c *CallbackConnectorConfig) HandleCallback(scopes connector.Scopes, r *http.Request) (connector.Identity, error) { + body, err := io.ReadAll(r.Body) + if err != nil { + return connector.Identity{}, fmt.Errorf("external connector %q: read body: %v", c.id, err) + } + + defer r.Body.Close() + + headers := map[string][]string(r.Header) + + response, err := c.client.HandleCallback(r.Context(), &sdk.CallbackReq{ + Scopes: toSDKScopes(scopes), + Body: body, + Headers: convertToListOfStrings(headers), + RawQuery: r.URL.RawQuery, + }) + if err != nil { + return connector.Identity{}, err + } + + return toConnectorIdentity(response.Identity), nil +} + +func (c *CallbackConnectorConfig) Refresh(ctx context.Context, scopes connector.Scopes, identity connector.Identity) (connector.Identity, error) { + response, err := c.client.Refresh(ctx, &sdk.RefreshReq{ + Scopes: toSDKScopes(scopes), Identity: toSDKIdentity(identity), + }) + if err != nil { + return connector.Identity{}, err + } + + return toConnectorIdentity(response.GetIdentity()), nil +} + +func convertToListOfStrings(oldMap map[string][]string) map[string]*sdk.ListOfStrings { + newMap := make(map[string]*sdk.ListOfStrings, len(oldMap)) + for k, v := range oldMap { + newMap[k] = &sdk.ListOfStrings{Value: v} + } + + return newMap +} diff --git a/connector/external/convert.go b/connector/external/convert.go new file mode 100644 index 0000000000..ec80b661b3 --- /dev/null +++ b/connector/external/convert.go @@ -0,0 +1,37 @@ +package external + +import ( + "github.com/dexidp/dex/connector" + "github.com/dexidp/dex/connector/external/sdk" +) + +func toSDKScopes(s connector.Scopes) *sdk.Scopes { + return &sdk.Scopes{ + OfflineAccess: s.OfflineAccess, + Groups: s.Groups, + } +} + +func toSDKIdentity(id connector.Identity) *sdk.Identity { + return &sdk.Identity{ + UserId: id.UserID, + Username: id.Username, + PreferredUsername: id.PreferredUsername, + Email: id.Email, + EmailVerified: id.EmailVerified, + Groups: id.Groups, + ConnectorData: id.ConnectorData, + } +} + +func toConnectorIdentity(id *sdk.Identity) connector.Identity { + return connector.Identity{ + UserID: id.UserId, + Username: id.Username, + PreferredUsername: id.PreferredUsername, + Email: id.Email, + EmailVerified: id.EmailVerified, + Groups: id.Groups, + ConnectorData: id.ConnectorData, + } +} diff --git a/connector/external/grpc.go b/connector/external/grpc.go new file mode 100644 index 0000000000..5598d644a7 --- /dev/null +++ b/connector/external/grpc.go @@ -0,0 +1,50 @@ +package external + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "os" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +type gRPCConnectorConfig struct { + Port int `json:"port"` + CAPath string `json:"tlsClientCA"` + ClientCrt string `json:"tlsCert"` + ClientKey string `json:"tlsKey"` +} + +func grpcConn(port int, ca, crt, key string) (*grpc.ClientConn, error) { + cPool := x509.NewCertPool() + caCert, err := os.ReadFile(ca) + if err != nil { + return nil, fmt.Errorf("invalid CA crt file: %s", ca) + } + + if !cPool.AppendCertsFromPEM(caCert) { + return nil, fmt.Errorf("failed to parse CA crt") + } + + clientCert, err := tls.LoadX509KeyPair(crt, key) + if err != nil { + return nil, fmt.Errorf("invalid client crt file: %s", crt) + } + + clientTLSConfig := &tls.Config{ + RootCAs: cPool, + Certificates: []tls.Certificate{clientCert}, + } + creds := credentials.NewTLS(clientTLSConfig) + + hostAndPort := fmt.Sprintf("127.0.0.1:%d", port) + + conn, err := grpc.Dial(hostAndPort, grpc.WithTransportCredentials(creds)) + if err != nil { + return nil, fmt.Errorf("dial: %v", err) + } + + return conn, nil +} diff --git a/connector/external/password.go b/connector/external/password.go new file mode 100644 index 0000000000..0852acce47 --- /dev/null +++ b/connector/external/password.go @@ -0,0 +1,68 @@ +package external + +import ( + "context" + + "github.com/dexidp/dex/connector" + "github.com/dexidp/dex/connector/external/sdk" + "github.com/dexidp/dex/pkg/log" +) + +type PasswordConnectorConfig struct { + gRPCConnectorConfig + + id string + logger log.Logger + + client sdk.PasswordConnectorClient +} + +func (c *PasswordConnectorConfig) Open(id string, logger log.Logger) (connector.Connector, error) { + conn, err := grpcConn(c.Port, c.CAPath, c.ClientCrt, c.ClientKey) + if err != nil { + return connector.Identity{}, err + } + + c.id = id + c.client = sdk.NewPasswordConnectorClient(conn) + c.logger = logger + return c, nil +} + +func (c *PasswordConnectorConfig) Prompt() string { + prompt := "username" + + response, err := c.client.Prompt(context.Background(), &sdk.PromptReq{}) + if err != nil { + c.logger.Errorf(err.Error()) + return prompt + } + + if response.Prompt != "" { + prompt = response.Prompt + } + + return prompt +} + +func (c *PasswordConnectorConfig) Login(ctx context.Context, scopes connector.Scopes, username, password string) (identity connector.Identity, validPassword bool, err error) { + response, err := c.client.Login(ctx, &sdk.LoginReq{ + Scopes: toSDKScopes(scopes), Username: username, Password: password, + }) + if err != nil { + return connector.Identity{}, false, err + } + + return toConnectorIdentity(response.GetIdentity()), response.GetValidPassword(), nil +} + +func (c *PasswordConnectorConfig) Refresh(ctx context.Context, scopes connector.Scopes, identity connector.Identity) (connector.Identity, error) { + response, err := c.client.Refresh(ctx, &sdk.RefreshReq{ + Scopes: toSDKScopes(scopes), Identity: toSDKIdentity(identity), + }) + if err != nil { + return connector.Identity{}, err + } + + return toConnectorIdentity(response.GetIdentity()), nil +} diff --git a/connector/external/sdk/go.mod b/connector/external/sdk/go.mod new file mode 100644 index 0000000000..0cf0910695 --- /dev/null +++ b/connector/external/sdk/go.mod @@ -0,0 +1,16 @@ +module github.com/dexidp/dex/connector/external/sdk + +go 1.17 + +require ( + google.golang.org/grpc v1.43.0 + google.golang.org/protobuf v1.27.1 +) + +require ( + github.com/golang/protobuf v1.5.0 // indirect + golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect + golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect + golang.org/x/text v0.3.0 // indirect + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect +) diff --git a/connector/external/sdk/go.sum b/connector/external/sdk/go.sum new file mode 100644 index 0000000000..2f028741b1 --- /dev/null +++ b/connector/external/sdk/go.sum @@ -0,0 +1,119 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/connector/external/sdk/sdk.pb.go b/connector/external/sdk/sdk.pb.go new file mode 100644 index 0000000000..9e8ecd3d6c --- /dev/null +++ b/connector/external/sdk/sdk.pb.go @@ -0,0 +1,1108 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.15.6 +// source: connector/external/sdk/sdk.proto + +package sdk + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ListOfStrings struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` +} + +func (x *ListOfStrings) Reset() { + *x = ListOfStrings{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListOfStrings) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListOfStrings) ProtoMessage() {} + +func (x *ListOfStrings) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListOfStrings.ProtoReflect.Descriptor instead. +func (*ListOfStrings) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{0} +} + +func (x *ListOfStrings) GetValue() []string { + if x != nil { + return x.Value + } + return nil +} + +// Identity represents the ID Token claims supported by the server. +type Identity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + PreferredUsername string `protobuf:"bytes,3,opt,name=preferred_username,json=preferredUsername,proto3" json:"preferred_username,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + EmailVerified bool `protobuf:"varint,5,opt,name=email_verified,json=emailVerified,proto3" json:"email_verified,omitempty"` + Groups []string `protobuf:"bytes,6,rep,name=groups,proto3" json:"groups,omitempty"` + // ConnectorData holds data used by the connector for subsequent requests after initial + // authentication, such as access tokens for upstream provides. + // + // This data is never shared with end users, OAuth clients, or through the API. + ConnectorData []byte `protobuf:"bytes,7,opt,name=connector_data,json=connectorData,proto3" json:"connector_data,omitempty"` +} + +func (x *Identity) Reset() { + *x = Identity{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Identity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Identity) ProtoMessage() {} + +func (x *Identity) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Identity.ProtoReflect.Descriptor instead. +func (*Identity) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{1} +} + +func (x *Identity) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *Identity) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *Identity) GetPreferredUsername() string { + if x != nil { + return x.PreferredUsername + } + return "" +} + +func (x *Identity) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *Identity) GetEmailVerified() bool { + if x != nil { + return x.EmailVerified + } + return false +} + +func (x *Identity) GetGroups() []string { + if x != nil { + return x.Groups + } + return nil +} + +func (x *Identity) GetConnectorData() []byte { + if x != nil { + return x.ConnectorData + } + return nil +} + +// Scopes represents additional data requested by the clients about the end user. +type Scopes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The client has requested a refresh token from the server. + OfflineAccess bool `protobuf:"varint,1,opt,name=offline_access,json=offlineAccess,proto3" json:"offline_access,omitempty"` + // The client has requested group information about the end user. + Groups bool `protobuf:"varint,2,opt,name=groups,proto3" json:"groups,omitempty"` +} + +func (x *Scopes) Reset() { + *x = Scopes{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Scopes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Scopes) ProtoMessage() {} + +func (x *Scopes) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Scopes.ProtoReflect.Descriptor instead. +func (*Scopes) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{2} +} + +func (x *Scopes) GetOfflineAccess() bool { + if x != nil { + return x.OfflineAccess + } + return false +} + +func (x *Scopes) GetGroups() bool { + if x != nil { + return x.Groups + } + return false +} + +type RefreshReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scopes *Scopes `protobuf:"bytes,1,opt,name=scopes,proto3" json:"scopes,omitempty"` + Identity *Identity `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` +} + +func (x *RefreshReq) Reset() { + *x = RefreshReq{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshReq) ProtoMessage() {} + +func (x *RefreshReq) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshReq.ProtoReflect.Descriptor instead. +func (*RefreshReq) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{3} +} + +func (x *RefreshReq) GetScopes() *Scopes { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *RefreshReq) GetIdentity() *Identity { + if x != nil { + return x.Identity + } + return nil +} + +type RefreshResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identity *Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` +} + +func (x *RefreshResp) Reset() { + *x = RefreshResp{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshResp) ProtoMessage() {} + +func (x *RefreshResp) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshResp.ProtoReflect.Descriptor instead. +func (*RefreshResp) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{4} +} + +func (x *RefreshResp) GetIdentity() *Identity { + if x != nil { + return x.Identity + } + return nil +} + +type PromptReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PromptReq) Reset() { + *x = PromptReq{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PromptReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PromptReq) ProtoMessage() {} + +func (x *PromptReq) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PromptReq.ProtoReflect.Descriptor instead. +func (*PromptReq) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{5} +} + +type PromptResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Prompt string `protobuf:"bytes,1,opt,name=prompt,proto3" json:"prompt,omitempty"` +} + +func (x *PromptResp) Reset() { + *x = PromptResp{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PromptResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PromptResp) ProtoMessage() {} + +func (x *PromptResp) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PromptResp.ProtoReflect.Descriptor instead. +func (*PromptResp) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{6} +} + +func (x *PromptResp) GetPrompt() string { + if x != nil { + return x.Prompt + } + return "" +} + +type LoginReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scopes *Scopes `protobuf:"bytes,1,opt,name=scopes,proto3" json:"scopes,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *LoginReq) Reset() { + *x = LoginReq{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginReq) ProtoMessage() {} + +func (x *LoginReq) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginReq.ProtoReflect.Descriptor instead. +func (*LoginReq) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{7} +} + +func (x *LoginReq) GetScopes() *Scopes { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *LoginReq) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginReq) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type LoginResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identity *Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + ValidPassword bool `protobuf:"varint,2,opt,name=valid_password,json=validPassword,proto3" json:"valid_password,omitempty"` +} + +func (x *LoginResp) Reset() { + *x = LoginResp{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginResp) ProtoMessage() {} + +func (x *LoginResp) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginResp.ProtoReflect.Descriptor instead. +func (*LoginResp) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{8} +} + +func (x *LoginResp) GetIdentity() *Identity { + if x != nil { + return x.Identity + } + return nil +} + +func (x *LoginResp) GetValidPassword() bool { + if x != nil { + return x.ValidPassword + } + return false +} + +type CallbackReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scopes *Scopes `protobuf:"bytes,1,opt,name=scopes,proto3" json:"scopes,omitempty"` + Body []byte `protobuf:"bytes,2,opt,name=Body,proto3" json:"Body,omitempty"` + Headers map[string]*ListOfStrings `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + RawQuery string `protobuf:"bytes,4,opt,name=raw_query,json=rawQuery,proto3" json:"raw_query,omitempty"` +} + +func (x *CallbackReq) Reset() { + *x = CallbackReq{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallbackReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallbackReq) ProtoMessage() {} + +func (x *CallbackReq) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallbackReq.ProtoReflect.Descriptor instead. +func (*CallbackReq) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{9} +} + +func (x *CallbackReq) GetScopes() *Scopes { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *CallbackReq) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +func (x *CallbackReq) GetHeaders() map[string]*ListOfStrings { + if x != nil { + return x.Headers + } + return nil +} + +func (x *CallbackReq) GetRawQuery() string { + if x != nil { + return x.RawQuery + } + return "" +} + +type CallbackResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identity *Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` +} + +func (x *CallbackResp) Reset() { + *x = CallbackResp{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallbackResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallbackResp) ProtoMessage() {} + +func (x *CallbackResp) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallbackResp.ProtoReflect.Descriptor instead. +func (*CallbackResp) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{10} +} + +func (x *CallbackResp) GetIdentity() *Identity { + if x != nil { + return x.Identity + } + return nil +} + +type LoginURLReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scopes *Scopes `protobuf:"bytes,1,opt,name=scopes,proto3" json:"scopes,omitempty"` + CallbackUrl string `protobuf:"bytes,2,opt,name=callback_url,json=callbackUrl,proto3" json:"callback_url,omitempty"` + State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` +} + +func (x *LoginURLReq) Reset() { + *x = LoginURLReq{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginURLReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginURLReq) ProtoMessage() {} + +func (x *LoginURLReq) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginURLReq.ProtoReflect.Descriptor instead. +func (*LoginURLReq) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{11} +} + +func (x *LoginURLReq) GetScopes() *Scopes { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *LoginURLReq) GetCallbackUrl() string { + if x != nil { + return x.CallbackUrl + } + return "" +} + +func (x *LoginURLReq) GetState() string { + if x != nil { + return x.State + } + return "" +} + +type LoginURLResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` +} + +func (x *LoginURLResp) Reset() { + *x = LoginURLResp{} + if protoimpl.UnsafeEnabled { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginURLResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginURLResp) ProtoMessage() {} + +func (x *LoginURLResp) ProtoReflect() protoreflect.Message { + mi := &file_connector_external_sdk_sdk_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginURLResp.ProtoReflect.Descriptor instead. +func (*LoginURLResp) Descriptor() ([]byte, []int) { + return file_connector_external_sdk_sdk_proto_rawDescGZIP(), []int{12} +} + +func (x *LoginURLResp) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +var File_connector_external_sdk_sdk_proto protoreflect.FileDescriptor + +var file_connector_external_sdk_sdk_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x73, 0x64, 0x6b, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x03, 0x73, 0x64, 0x6b, 0x22, 0x25, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x4f, + 0x66, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xea, + 0x01, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 0x72, + 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x61, 0x74, 0x61, 0x22, 0x47, 0x0a, 0x06, 0x53, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, + 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6f, + 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x22, 0x5c, 0x0a, 0x0a, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, + 0x65, 0x71, 0x12, 0x23, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, + 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x64, 0x6b, 0x2e, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x22, 0x38, 0x0a, 0x0b, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x29, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x0b, 0x0a, 0x09, + 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x65, 0x71, 0x22, 0x24, 0x0a, 0x0a, 0x50, 0x72, 0x6f, + 0x6d, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6d, 0x70, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x22, + 0x67, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x23, 0x0a, 0x06, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x73, 0x64, + 0x6b, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, + 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x5d, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0xec, 0x01, 0x0a, 0x0b, 0x43, 0x61, 0x6c, 0x6c, + 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x23, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x42, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x42, 0x6f, 0x64, 0x79, + 0x12, 0x37, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x52, 0x65, 0x71, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x77, + 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x61, + 0x77, 0x51, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x4e, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x4f, 0x66, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x39, 0x0a, 0x0c, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x22, 0x6b, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x71, + 0x12, 0x23, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, + 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x6c, + 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x20, + 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x32, 0x9a, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2b, 0x0a, 0x06, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, + 0x12, 0x0e, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x0f, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x28, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0d, 0x2e, 0x73, + 0x64, 0x6b, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x73, 0x64, + 0x6b, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x2e, 0x0a, + 0x07, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x0f, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x52, + 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x73, 0x64, 0x6b, 0x2e, + 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x32, 0xaf, 0x01, + 0x0a, 0x11, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x12, 0x31, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x12, + 0x10, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x52, 0x65, + 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x52, 0x4c, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x10, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x43, + 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x64, 0x6b, + 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, + 0x2e, 0x0a, 0x07, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x0f, 0x2e, 0x73, 0x64, 0x6b, + 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x73, 0x64, + 0x6b, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, + 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, + 0x78, 0x69, 0x64, 0x70, 0x2f, 0x64, 0x65, 0x78, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x64, 0x6b, 0x3b, + 0x73, 0x64, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_connector_external_sdk_sdk_proto_rawDescOnce sync.Once + file_connector_external_sdk_sdk_proto_rawDescData = file_connector_external_sdk_sdk_proto_rawDesc +) + +func file_connector_external_sdk_sdk_proto_rawDescGZIP() []byte { + file_connector_external_sdk_sdk_proto_rawDescOnce.Do(func() { + file_connector_external_sdk_sdk_proto_rawDescData = protoimpl.X.CompressGZIP(file_connector_external_sdk_sdk_proto_rawDescData) + }) + return file_connector_external_sdk_sdk_proto_rawDescData +} + +var file_connector_external_sdk_sdk_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_connector_external_sdk_sdk_proto_goTypes = []interface{}{ + (*ListOfStrings)(nil), // 0: sdk.ListOfStrings + (*Identity)(nil), // 1: sdk.Identity + (*Scopes)(nil), // 2: sdk.Scopes + (*RefreshReq)(nil), // 3: sdk.RefreshReq + (*RefreshResp)(nil), // 4: sdk.RefreshResp + (*PromptReq)(nil), // 5: sdk.PromptReq + (*PromptResp)(nil), // 6: sdk.PromptResp + (*LoginReq)(nil), // 7: sdk.LoginReq + (*LoginResp)(nil), // 8: sdk.LoginResp + (*CallbackReq)(nil), // 9: sdk.CallbackReq + (*CallbackResp)(nil), // 10: sdk.CallbackResp + (*LoginURLReq)(nil), // 11: sdk.LoginURLReq + (*LoginURLResp)(nil), // 12: sdk.LoginURLResp + nil, // 13: sdk.CallbackReq.HeadersEntry +} +var file_connector_external_sdk_sdk_proto_depIdxs = []int32{ + 2, // 0: sdk.RefreshReq.scopes:type_name -> sdk.Scopes + 1, // 1: sdk.RefreshReq.identity:type_name -> sdk.Identity + 1, // 2: sdk.RefreshResp.identity:type_name -> sdk.Identity + 2, // 3: sdk.LoginReq.scopes:type_name -> sdk.Scopes + 1, // 4: sdk.LoginResp.identity:type_name -> sdk.Identity + 2, // 5: sdk.CallbackReq.scopes:type_name -> sdk.Scopes + 13, // 6: sdk.CallbackReq.headers:type_name -> sdk.CallbackReq.HeadersEntry + 1, // 7: sdk.CallbackResp.identity:type_name -> sdk.Identity + 2, // 8: sdk.LoginURLReq.scopes:type_name -> sdk.Scopes + 0, // 9: sdk.CallbackReq.HeadersEntry.value:type_name -> sdk.ListOfStrings + 5, // 10: sdk.PasswordConnector.Prompt:input_type -> sdk.PromptReq + 7, // 11: sdk.PasswordConnector.Login:input_type -> sdk.LoginReq + 3, // 12: sdk.PasswordConnector.Refresh:input_type -> sdk.RefreshReq + 11, // 13: sdk.CallbackConnector.LoginURL:input_type -> sdk.LoginURLReq + 9, // 14: sdk.CallbackConnector.HandleCallback:input_type -> sdk.CallbackReq + 3, // 15: sdk.CallbackConnector.Refresh:input_type -> sdk.RefreshReq + 6, // 16: sdk.PasswordConnector.Prompt:output_type -> sdk.PromptResp + 8, // 17: sdk.PasswordConnector.Login:output_type -> sdk.LoginResp + 4, // 18: sdk.PasswordConnector.Refresh:output_type -> sdk.RefreshResp + 12, // 19: sdk.CallbackConnector.LoginURL:output_type -> sdk.LoginURLResp + 10, // 20: sdk.CallbackConnector.HandleCallback:output_type -> sdk.CallbackResp + 4, // 21: sdk.CallbackConnector.Refresh:output_type -> sdk.RefreshResp + 16, // [16:22] is the sub-list for method output_type + 10, // [10:16] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_connector_external_sdk_sdk_proto_init() } +func file_connector_external_sdk_sdk_proto_init() { + if File_connector_external_sdk_sdk_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_connector_external_sdk_sdk_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListOfStrings); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Identity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Scopes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PromptReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PromptResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallbackReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallbackResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginURLReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_connector_external_sdk_sdk_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginURLResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_connector_external_sdk_sdk_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_connector_external_sdk_sdk_proto_goTypes, + DependencyIndexes: file_connector_external_sdk_sdk_proto_depIdxs, + MessageInfos: file_connector_external_sdk_sdk_proto_msgTypes, + }.Build() + File_connector_external_sdk_sdk_proto = out.File + file_connector_external_sdk_sdk_proto_rawDesc = nil + file_connector_external_sdk_sdk_proto_goTypes = nil + file_connector_external_sdk_sdk_proto_depIdxs = nil +} diff --git a/connector/external/sdk/sdk.proto b/connector/external/sdk/sdk.proto new file mode 100644 index 0000000000..f3648b292a --- /dev/null +++ b/connector/external/sdk/sdk.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; + +package sdk; + +option go_package = "github.com/dexidp/dex/connector/external/sdk;sdk"; + + +message ListOfStrings { + repeated string value = 1; +} + +// Identity represents the ID Token claims supported by the server. +message Identity { + string user_id = 1; + string username = 2; + string preferred_username = 3; + string email = 4; + bool email_verified = 5; + repeated string groups = 6; + // ConnectorData holds data used by the connector for subsequent requests after initial + // authentication, such as access tokens for upstream provides. + // + // This data is never shared with end users, OAuth clients, or through the API. + bytes connector_data = 7; +} + +// Scopes represents additional data requested by the clients about the end user. +message Scopes { + // The client has requested a refresh token from the server. + bool offline_access = 1; + // The client has requested group information about the end user. + bool groups = 2; +} + +message RefreshReq { + Scopes scopes = 1; + Identity identity = 2; +} + +message RefreshResp { + Identity identity = 1; +} + +message PromptReq {} + +message PromptResp { + string prompt = 1; +} + +message LoginReq { + Scopes scopes = 1; + string username = 2; + string password = 3; +} + +message LoginResp { + Identity identity = 1; + bool valid_password = 2; +} + +message CallbackReq { + Scopes scopes = 1; + bytes Body = 2; + + map headers = 3; + string raw_query = 4; +} + +message CallbackResp { + Identity identity = 1; +} + +message LoginURLReq { + Scopes scopes = 1; + string callback_url = 2; + string state = 3; +} + +message LoginURLResp { + string url = 1; +} + +// PasswordConnector represents the dex external password connector gRPC service. +service PasswordConnector { + rpc Prompt(PromptReq) returns (PromptResp) {}; + rpc Login(LoginReq) returns (LoginResp) {}; + rpc Refresh(RefreshReq) returns (RefreshResp) {}; +} + +// CallbackConnector represents the dex external callback connector gRPC service. +service CallbackConnector { + rpc LoginURL(LoginURLReq) returns (LoginURLResp) {}; + rpc HandleCallback(CallbackReq) returns (CallbackResp) {}; + rpc Refresh(RefreshReq) returns (RefreshResp) {}; +} diff --git a/connector/external/sdk/sdk_grpc.pb.go b/connector/external/sdk/sdk_grpc.pb.go new file mode 100644 index 0000000000..7639e5c617 --- /dev/null +++ b/connector/external/sdk/sdk_grpc.pb.go @@ -0,0 +1,331 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package sdk + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PasswordConnectorClient is the client API for PasswordConnector service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PasswordConnectorClient interface { + Prompt(ctx context.Context, in *PromptReq, opts ...grpc.CallOption) (*PromptResp, error) + Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error) + Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*RefreshResp, error) +} + +type passwordConnectorClient struct { + cc grpc.ClientConnInterface +} + +func NewPasswordConnectorClient(cc grpc.ClientConnInterface) PasswordConnectorClient { + return &passwordConnectorClient{cc} +} + +func (c *passwordConnectorClient) Prompt(ctx context.Context, in *PromptReq, opts ...grpc.CallOption) (*PromptResp, error) { + out := new(PromptResp) + err := c.cc.Invoke(ctx, "/sdk.PasswordConnector/Prompt", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *passwordConnectorClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error) { + out := new(LoginResp) + err := c.cc.Invoke(ctx, "/sdk.PasswordConnector/Login", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *passwordConnectorClient) Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*RefreshResp, error) { + out := new(RefreshResp) + err := c.cc.Invoke(ctx, "/sdk.PasswordConnector/Refresh", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PasswordConnectorServer is the server API for PasswordConnector service. +// All implementations must embed UnimplementedPasswordConnectorServer +// for forward compatibility +type PasswordConnectorServer interface { + Prompt(context.Context, *PromptReq) (*PromptResp, error) + Login(context.Context, *LoginReq) (*LoginResp, error) + Refresh(context.Context, *RefreshReq) (*RefreshResp, error) + mustEmbedUnimplementedPasswordConnectorServer() +} + +// UnimplementedPasswordConnectorServer must be embedded to have forward compatible implementations. +type UnimplementedPasswordConnectorServer struct { +} + +func (UnimplementedPasswordConnectorServer) Prompt(context.Context, *PromptReq) (*PromptResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Prompt not implemented") +} +func (UnimplementedPasswordConnectorServer) Login(context.Context, *LoginReq) (*LoginResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (UnimplementedPasswordConnectorServer) Refresh(context.Context, *RefreshReq) (*RefreshResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Refresh not implemented") +} +func (UnimplementedPasswordConnectorServer) mustEmbedUnimplementedPasswordConnectorServer() {} + +// UnsafePasswordConnectorServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PasswordConnectorServer will +// result in compilation errors. +type UnsafePasswordConnectorServer interface { + mustEmbedUnimplementedPasswordConnectorServer() +} + +func RegisterPasswordConnectorServer(s grpc.ServiceRegistrar, srv PasswordConnectorServer) { + s.RegisterService(&PasswordConnector_ServiceDesc, srv) +} + +func _PasswordConnector_Prompt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PromptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PasswordConnectorServer).Prompt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sdk.PasswordConnector/Prompt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PasswordConnectorServer).Prompt(ctx, req.(*PromptReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PasswordConnector_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PasswordConnectorServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sdk.PasswordConnector/Login", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PasswordConnectorServer).Login(ctx, req.(*LoginReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PasswordConnector_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RefreshReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PasswordConnectorServer).Refresh(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sdk.PasswordConnector/Refresh", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PasswordConnectorServer).Refresh(ctx, req.(*RefreshReq)) + } + return interceptor(ctx, in, info, handler) +} + +// PasswordConnector_ServiceDesc is the grpc.ServiceDesc for PasswordConnector service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PasswordConnector_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "sdk.PasswordConnector", + HandlerType: (*PasswordConnectorServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Prompt", + Handler: _PasswordConnector_Prompt_Handler, + }, + { + MethodName: "Login", + Handler: _PasswordConnector_Login_Handler, + }, + { + MethodName: "Refresh", + Handler: _PasswordConnector_Refresh_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "connector/external/sdk/sdk.proto", +} + +// CallbackConnectorClient is the client API for CallbackConnector service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type CallbackConnectorClient interface { + LoginURL(ctx context.Context, in *LoginURLReq, opts ...grpc.CallOption) (*LoginURLResp, error) + HandleCallback(ctx context.Context, in *CallbackReq, opts ...grpc.CallOption) (*CallbackResp, error) + Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*RefreshResp, error) +} + +type callbackConnectorClient struct { + cc grpc.ClientConnInterface +} + +func NewCallbackConnectorClient(cc grpc.ClientConnInterface) CallbackConnectorClient { + return &callbackConnectorClient{cc} +} + +func (c *callbackConnectorClient) LoginURL(ctx context.Context, in *LoginURLReq, opts ...grpc.CallOption) (*LoginURLResp, error) { + out := new(LoginURLResp) + err := c.cc.Invoke(ctx, "/sdk.CallbackConnector/LoginURL", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *callbackConnectorClient) HandleCallback(ctx context.Context, in *CallbackReq, opts ...grpc.CallOption) (*CallbackResp, error) { + out := new(CallbackResp) + err := c.cc.Invoke(ctx, "/sdk.CallbackConnector/HandleCallback", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *callbackConnectorClient) Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*RefreshResp, error) { + out := new(RefreshResp) + err := c.cc.Invoke(ctx, "/sdk.CallbackConnector/Refresh", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CallbackConnectorServer is the server API for CallbackConnector service. +// All implementations must embed UnimplementedCallbackConnectorServer +// for forward compatibility +type CallbackConnectorServer interface { + LoginURL(context.Context, *LoginURLReq) (*LoginURLResp, error) + HandleCallback(context.Context, *CallbackReq) (*CallbackResp, error) + Refresh(context.Context, *RefreshReq) (*RefreshResp, error) + mustEmbedUnimplementedCallbackConnectorServer() +} + +// UnimplementedCallbackConnectorServer must be embedded to have forward compatible implementations. +type UnimplementedCallbackConnectorServer struct { +} + +func (UnimplementedCallbackConnectorServer) LoginURL(context.Context, *LoginURLReq) (*LoginURLResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoginURL not implemented") +} +func (UnimplementedCallbackConnectorServer) HandleCallback(context.Context, *CallbackReq) (*CallbackResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method HandleCallback not implemented") +} +func (UnimplementedCallbackConnectorServer) Refresh(context.Context, *RefreshReq) (*RefreshResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Refresh not implemented") +} +func (UnimplementedCallbackConnectorServer) mustEmbedUnimplementedCallbackConnectorServer() {} + +// UnsafeCallbackConnectorServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CallbackConnectorServer will +// result in compilation errors. +type UnsafeCallbackConnectorServer interface { + mustEmbedUnimplementedCallbackConnectorServer() +} + +func RegisterCallbackConnectorServer(s grpc.ServiceRegistrar, srv CallbackConnectorServer) { + s.RegisterService(&CallbackConnector_ServiceDesc, srv) +} + +func _CallbackConnector_LoginURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginURLReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CallbackConnectorServer).LoginURL(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sdk.CallbackConnector/LoginURL", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CallbackConnectorServer).LoginURL(ctx, req.(*LoginURLReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _CallbackConnector_HandleCallback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CallbackReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CallbackConnectorServer).HandleCallback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sdk.CallbackConnector/HandleCallback", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CallbackConnectorServer).HandleCallback(ctx, req.(*CallbackReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _CallbackConnector_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RefreshReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CallbackConnectorServer).Refresh(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sdk.CallbackConnector/Refresh", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CallbackConnectorServer).Refresh(ctx, req.(*RefreshReq)) + } + return interceptor(ctx, in, info, handler) +} + +// CallbackConnector_ServiceDesc is the grpc.ServiceDesc for CallbackConnector service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var CallbackConnector_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "sdk.CallbackConnector", + HandlerType: (*CallbackConnectorServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "LoginURL", + Handler: _CallbackConnector_LoginURL_Handler, + }, + { + MethodName: "HandleCallback", + Handler: _CallbackConnector_HandleCallback_Handler, + }, + { + MethodName: "Refresh", + Handler: _CallbackConnector_Refresh_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "connector/external/sdk/sdk.proto", +} diff --git a/examples/config-dev.yaml b/examples/config-dev.yaml index 6cae823cfd..945a8f2706 100644 --- a/examples/config-dev.yaml +++ b/examples/config-dev.yaml @@ -131,6 +131,14 @@ connectors: # redirectURI: http://127.0.0.1:5556/dex/callback # hostedDomains: # - $GOOGLE_HOSTED_DOMAIN +# - type: externalPassword +# id: password +# name: MyConnector +# config: +# port: 5570 +# tlsCert: examples/external-connector/server.crt +# tlsKey: examples/external-connector/server.key +# tlsClientCA: examples/external-connector/ca.crt # Let dex keep a list of passwords which can be used to login to dex. enablePasswordDB: true diff --git a/examples/external-connector/main.go b/examples/external-connector/main.go new file mode 100644 index 0000000000..da1cbce453 --- /dev/null +++ b/examples/external-connector/main.go @@ -0,0 +1,79 @@ +package main + +import ( + "context" + "crypto/tls" + "flag" + "fmt" + "log" + "net" + + "github.com/dexidp/dex/connector/external/sdk" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +var inMemoryUsersStore = map[string]string{ + "jane-doe": "the-most-secure-password", +} + +type connector struct { + sdk.UnimplementedPasswordConnectorServer +} + +func (c *connector) Prompt(_ context.Context, _ *sdk.PromptReq) (*sdk.PromptResp, error) { + return &sdk.PromptResp{Prompt: "Test user"}, nil +} + +func (c *connector) Login(_ context.Context, req *sdk.LoginReq) (*sdk.LoginResp, error) { + resp := &sdk.LoginResp{ + Identity: &sdk.Identity{UserId: req.Username, Username: req.Username}, + } + if inMemoryUsersStore[req.Username] == req.Password { + resp.ValidPassword = true + } + return resp, nil +} + +func (c *connector) Refresh(_ context.Context, req *sdk.RefreshReq) (*sdk.RefreshResp, error) { + return &sdk.RefreshResp{Identity: req.Identity}, nil +} + +func main() { + var ( + listenAddress string + tlsCert string + tlsKey string + ) + + flag.StringVar(&listenAddress, "listen-address", "127.0.0.1:5571", "Address to listen on") + + flag.StringVar(&tlsCert, "tls-cert", "examples/external-gitlab/server.crt", "SSL certificate") + flag.StringVar(&tlsKey, "tls-key", "examples/external-gitlab/server.key", "SSL certificate key") + + flag.Parse() + + grpcListener, err := net.Listen("tcp", listenAddress) + if err != nil { + log.Fatalln(err.Error()) + } + + cert, err := tls.LoadX509KeyPair(tlsCert, tlsKey) + if err != nil { + log.Fatalf("invalid config: error parsing gRPC certificate file: %v", err) + } + + tlsConfig := tls.Config{ + Certificates: []tls.Certificate{cert}, + MinVersion: tls.VersionTLS12, + PreferServerCipherSuites: true, + } + + grpcSrv := grpc.NewServer(grpc.Creds(credentials.NewTLS(&tlsConfig))) + sdk.RegisterPasswordConnectorServer(grpcSrv, &connector{}) + + fmt.Printf("Connector started on: %s", listenAddress) + if err := grpcSrv.Serve(grpcListener); err != nil { + log.Fatalln(err.Error()) + } +} diff --git a/examples/external-gitlab/main.go b/examples/external-gitlab/main.go new file mode 100644 index 0000000000..808a6bf544 --- /dev/null +++ b/examples/external-gitlab/main.go @@ -0,0 +1,333 @@ +package main + +import ( + "context" + "crypto/tls" + "encoding/json" + "errors" + "flag" + "fmt" + "io" + "log" + "net" + "net/http" + "net/url" + "strconv" + + "github.com/dexidp/dex/connector/external/sdk" + "golang.org/x/oauth2" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +func filter(given, required []string) []string { + groups := []string{} + groupFilter := make(map[string]struct{}) + for _, group := range required { + groupFilter[group] = struct{}{} + } + for _, group := range given { + if _, ok := groupFilter[group]; ok { + groups = append(groups, group) + } + } + return groups +} + +const ( + // read operations of the /api/v4/user endpoint + scopeUser = "read_user" + // used to retrieve groups from /oauth/userinfo + // https://docs.gitlab.com/ee/integration/openid_connect_provider.html + scopeOpenID = "openid" +) + +type gitlabUser struct { + ID int + Name string + Username string + State string + Email string + IsAdmin bool +} + +type connectorData struct { + // GitLab's OAuth2 tokens never expire. We don't need a refresh token. + AccessToken string `json:"accessToken"` +} + +type gitlabConnector struct { + sdk.UnimplementedCallbackConnectorServer + + baseURL string + redirectURI string + groups []string + clientID string + clientSecret string + httpClient *http.Client + // if set to true will use the user's handle rather than their numeric id as the ID + useLoginAsID bool +} + +func (c *gitlabConnector) oauth2Config(scopes *sdk.Scopes) *oauth2.Config { + gitlabScopes := []string{scopeUser} + if c.groupsRequired(scopes.Groups) { + gitlabScopes = []string{scopeUser, scopeOpenID} + } + + gitlabEndpoint := oauth2.Endpoint{AuthURL: c.baseURL + "/oauth/authorize", TokenURL: c.baseURL + "/oauth/token"} + return &oauth2.Config{ + ClientID: c.clientID, + ClientSecret: c.clientSecret, + Endpoint: gitlabEndpoint, + Scopes: gitlabScopes, + RedirectURL: c.redirectURI, + } +} + +func (c *gitlabConnector) LoginURL(_ context.Context, req *sdk.LoginURLReq) (*sdk.LoginURLResp, error) { + if c.redirectURI != req.CallbackUrl { + return nil, fmt.Errorf("expected callback URL %q did not match the URL in the config %q", c.redirectURI, req.CallbackUrl) + } + return &sdk.LoginURLResp{Url: c.oauth2Config(req.Scopes).AuthCodeURL(req.State)}, nil +} + +type oauth2Error struct { + error string + errorDescription string +} + +func (e *oauth2Error) Error() string { + if e.errorDescription == "" { + return e.error + } + return e.error + ": " + e.errorDescription +} + +func (c *gitlabConnector) HandleCallback(ctx context.Context, req *sdk.CallbackReq) (resp *sdk.CallbackResp, err error) { + q, _ := url.ParseQuery(req.RawQuery) + + if errType := q.Get("error"); errType != "" { + return nil, &oauth2Error{errType, q.Get("error_description")} + } + + oauth2Config := c.oauth2Config(req.Scopes) + if c.httpClient != nil { + ctx = context.WithValue(ctx, oauth2.HTTPClient, c.httpClient) + } + + token, err := oauth2Config.Exchange(ctx, q.Get("code")) + if err != nil { + return nil, fmt.Errorf("gitlab: failed to get token: %v", err) + } + + client := oauth2Config.Client(ctx, token) + + user, err := c.user(ctx, client) + if err != nil { + return nil, fmt.Errorf("gitlab: get user: %v", err) + } + + username := user.Name + if username == "" { + username = user.Email + } + + identity := &sdk.Identity{ + UserId: strconv.Itoa(user.ID), + Username: username, + PreferredUsername: user.Username, + Email: user.Email, + EmailVerified: true, + } + if c.useLoginAsID { + identity.UserId = user.Username + } + + if c.groupsRequired(req.Scopes.Groups) { + groups, err := c.getGroups(ctx, client, req.Scopes.Groups, user.Username) + if err != nil { + return &sdk.CallbackResp{Identity: identity}, fmt.Errorf("gitlab: get groups: %v", err) + } + identity.Groups = groups + } + + if req.Scopes.OfflineAccess { + data := connectorData{AccessToken: token.AccessToken} + connData, err := json.Marshal(data) + if err != nil { + return &sdk.CallbackResp{Identity: identity}, fmt.Errorf("marshal connector data: %v", err) + } + identity.ConnectorData = connData + } + + return &sdk.CallbackResp{Identity: identity}, nil +} + +func (c *gitlabConnector) Refresh(ctx context.Context, req *sdk.RefreshReq) (*sdk.RefreshResp, error) { + if len(req.Identity.ConnectorData) == 0 { + return &sdk.RefreshResp{Identity: req.Identity}, errors.New("no upstream access token found") + } + + var data connectorData + if err := json.Unmarshal(req.Identity.ConnectorData, &data); err != nil { + return &sdk.RefreshResp{Identity: req.Identity}, fmt.Errorf("gitlab: unmarshal access token: %v", err) + } + + client := c.oauth2Config(req.Scopes).Client(ctx, &oauth2.Token{AccessToken: data.AccessToken}) + user, err := c.user(ctx, client) + if err != nil { + return &sdk.RefreshResp{Identity: req.Identity}, fmt.Errorf("gitlab: get user: %v", err) + } + + username := user.Name + if username == "" { + username = user.Email + } + req.Identity.Username = username + req.Identity.PreferredUsername = user.Username + req.Identity.Email = user.Email + + if c.groupsRequired(req.Scopes.Groups) { + groups, err := c.getGroups(ctx, client, req.Scopes.Groups, user.Username) + if err != nil { + return &sdk.RefreshResp{Identity: req.Identity}, fmt.Errorf("gitlab: get groups: %v", err) + } + req.Identity.Groups = groups + } + return &sdk.RefreshResp{Identity: req.Identity}, nil +} + +func (c *gitlabConnector) groupsRequired(groupScope bool) bool { + return len(c.groups) > 0 || groupScope +} + +// user queries the GitLab API for profile information using the provided client. The HTTP +// client is expected to be constructed by the golang.org/x/oauth2 package, which inserts +// a bearer token as part of the request. +func (c *gitlabConnector) user(ctx context.Context, client *http.Client) (gitlabUser, error) { + var u gitlabUser + req, err := http.NewRequest("GET", c.baseURL+"/api/v4/user", nil) + if err != nil { + return u, fmt.Errorf("gitlab: new req: %v", err) + } + req = req.WithContext(ctx) + resp, err := client.Do(req) + if err != nil { + return u, fmt.Errorf("gitlab: get URL %v", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + body, err := io.ReadAll(resp.Body) + if err != nil { + return u, fmt.Errorf("gitlab: read body: %v", err) + } + return u, fmt.Errorf("%s: %s", resp.Status, body) + } + + if err := json.NewDecoder(resp.Body).Decode(&u); err != nil { + return u, fmt.Errorf("failed to decode response: %v", err) + } + return u, nil +} + +type userInfo struct { + Groups []string +} + +// userGroups queries the GitLab API for group membership. +// +// The HTTP passed client is expected to be constructed by the golang.org/x/oauth2 package, +// which inserts a bearer token as part of the request. +func (c *gitlabConnector) userGroups(ctx context.Context, client *http.Client) ([]string, error) { + req, err := http.NewRequest("GET", c.baseURL+"/oauth/userinfo", nil) + if err != nil { + return nil, fmt.Errorf("gitlab: new req: %v", err) + } + req = req.WithContext(ctx) + resp, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("gitlab: get URL %v", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("gitlab: read body: %v", err) + } + return nil, fmt.Errorf("%s: %s", resp.Status, body) + } + var u userInfo + if err := json.NewDecoder(resp.Body).Decode(&u); err != nil { + return nil, fmt.Errorf("failed to decode response: %v", err) + } + + return u.Groups, nil +} + +func (c *gitlabConnector) getGroups(ctx context.Context, client *http.Client, groupScope bool, userLogin string) ([]string, error) { + gitlabGroups, err := c.userGroups(ctx, client) + if err != nil { + return nil, err + } + + if len(c.groups) > 0 { + filteredGroups := filter(gitlabGroups, c.groups) + if len(filteredGroups) == 0 { + return nil, fmt.Errorf("gitlab: user %q is not in any of the required groups", userLogin) + } + return filteredGroups, nil + } else if groupScope { + return gitlabGroups, nil + } + + return nil, nil +} + +func main() { + var ( + listenAddress string + tlsCert string + tlsKey string + ) + + connector := &gitlabConnector{} + + flag.StringVar(&listenAddress, "listen-address", "127.0.0.1:5571", "Address to listen on") + flag.StringVar(&connector.baseURL, "gitlab.base-url", "https://gitlab.com", "Gitlab URL") + flag.StringVar(&connector.clientID, "gitlab.client-id", "", "Gitlab application client ID") + flag.StringVar(&connector.clientSecret, "gitlab.client-secret", "", "Gitlab application client secret") + flag.StringVar(&connector.redirectURI, "gitlab.redirect-url", "http://127.0.0.1:5556/dex/callback", "Redirect URL for receiving callbacks") + + flag.StringVar(&tlsCert, "tls-cert", "examples/external-gitlab/server.crt", "SSL certificate") + flag.StringVar(&tlsKey, "tls-key", "examples/external-gitlab/server.key", "SSL certificate key") + + flag.Parse() + + grpcListener, err := net.Listen("tcp", listenAddress) + if err != nil { + log.Fatalln(err.Error()) + } + + cert, err := tls.LoadX509KeyPair(tlsCert, tlsKey) + if err != nil { + log.Fatalf("invalid config: error parsing gRPC certificate file: %v", err) + } + + tlsConfig := tls.Config{ + Certificates: []tls.Certificate{cert}, + MinVersion: tls.VersionTLS12, + PreferServerCipherSuites: true, + } + + grpcSrv := grpc.NewServer(grpc.Creds(credentials.NewTLS(&tlsConfig))) + + fmt.Printf("Connector started on: %s\n", listenAddress) + + sdk.RegisterCallbackConnectorServer(grpcSrv, connector) + if err := grpcSrv.Serve(grpcListener); err != nil { + log.Fatalln(err.Error()) + } +} diff --git a/examples/go.mod b/examples/go.mod index fc1405d615..531a97d437 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -5,7 +5,11 @@ go 1.14 require ( github.com/coreos/go-oidc/v3 v3.0.0 github.com/dexidp/dex/api/v2 v2.0.0-20200715135117-cb46a28c3ce2 + github.com/dexidp/dex/connector/external/sdk v0.0.0 github.com/spf13/cobra v1.0.0 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d - google.golang.org/grpc v1.26.0 + google.golang.org/grpc v1.43.0 ) + +// TODO(nabokihms): Required only to test it before merging. May be removed after merging to the master branch. +replace github.com/dexidp/dex/connector/external/sdk => ../connector/external/sdk diff --git a/examples/go.sum b/examples/go.sum index f27e7ca36e..27eb2a1ec9 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -4,12 +4,20 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-oidc/v3 v3.0.0 h1:/mAA0XMgYJw2Uqm7WKGCsKnjitE/+A0FFbOmiRJm7LQ= @@ -25,7 +33,11 @@ github.com/dexidp/dex/api/v2 v2.0.0-20200715135117-cb46a28c3ce2 h1:7dhZfOv4rPQob github.com/dexidp/dex/api/v2 v2.0.0-20200715135117-cb46a28c3ce2/go.mod h1:k5arBJT1QYvpsEY3sEd0NXJp3hKWKuUUfzJ3BlcqPdM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -35,23 +47,37 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -87,6 +113,7 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -102,21 +129,23 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -128,10 +157,11 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20200505041828-1ed23360d12c h1:zJ0mtu4jCalhKg6Oaukv6iIkb+cOvDrajDH9DH46Q4M= golang.org/x/net v0.0.0-20200505041828-1ed23360d12c/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -143,8 +173,8 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= @@ -155,19 +185,39 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= @@ -177,7 +227,9 @@ gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/go.mod b/go.mod index e446ba02a7..a3ca322abb 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/beevik/etree v1.1.0 github.com/coreos/go-oidc/v3 v3.1.0 github.com/dexidp/dex/api/v2 v2.0.0 + github.com/dexidp/dex/connector/external/sdk v0.0.0 github.com/felixge/httpsnoop v1.0.2 github.com/ghodss/yaml v1.0.0 github.com/go-ldap/ldap/v3 v3.4.1 @@ -83,3 +84,5 @@ require ( ) replace github.com/dexidp/dex/api/v2 => ./api/v2 + +replace github.com/dexidp/dex/connector/external/sdk => ./connector/external/sdk diff --git a/go.sum b/go.sum index 73f9570cde..2c7bacca0e 100644 --- a/go.sum +++ b/go.sum @@ -167,6 +167,7 @@ github.com/go-ldap/ldap/v3 v3.4.1/go.mod h1:iYS1MdmrmceOJ1QOTnRXrIs7i3kloqtmGQjR github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= github.com/go-sql-driver/mysql v1.5.1-0.20200311113236-681ffa848bae/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= @@ -366,6 +367,7 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/KYA= @@ -400,6 +402,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -578,6 +581,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0 h1:UG21uOlmZabA4fW5i7ZX6bjw1xELEGg/ZLgZq9auk/Q= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -797,6 +801,7 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/server/server.go b/server/server.go old mode 100755 new mode 100644 index 6b653fdbce..d92f3421bc --- a/server/server.go +++ b/server/server.go @@ -29,6 +29,7 @@ import ( "github.com/dexidp/dex/connector/atlassiancrowd" "github.com/dexidp/dex/connector/authproxy" "github.com/dexidp/dex/connector/bitbucketcloud" + "github.com/dexidp/dex/connector/external" "github.com/dexidp/dex/connector/gitea" "github.com/dexidp/dex/connector/github" "github.com/dexidp/dex/connector/gitlab" @@ -549,6 +550,9 @@ var ConnectorsConfig = map[string]func() ConnectorConfig{ "atlassian-crowd": func() ConnectorConfig { return new(atlassiancrowd.Config) }, // Keep around for backwards compatibility. "samlExperimental": func() ConnectorConfig { return new(saml.Config) }, + // External connectors + "externalPassword": func() ConnectorConfig { return new(external.PasswordConnectorConfig) }, + "externalCallback": func() ConnectorConfig { return new(external.CallbackConnectorConfig) }, } // openConnector will parse the connector config and open the connector.