commit
e18510b16e
17
Makefile
17
Makefile
@ -24,6 +24,7 @@ GOLANGCI_VERSION = 1.32.2
|
|||||||
|
|
||||||
PROTOC_VERSION = 3.15.6
|
PROTOC_VERSION = 3.15.6
|
||||||
PROTOC_GEN_GO_VERSION = 1.26.0
|
PROTOC_GEN_GO_VERSION = 1.26.0
|
||||||
|
PROTOC_GEN_GO_GRPC_VERSION = 1.1.0
|
||||||
|
|
||||||
build: bin/dex
|
build: bin/dex
|
||||||
|
|
||||||
@ -94,8 +95,8 @@ fix: bin/golangci-lint ## Fix lint violations
|
|||||||
docker-image:
|
docker-image:
|
||||||
@sudo docker build -t $(DOCKER_IMAGE) .
|
@sudo docker build -t $(DOCKER_IMAGE) .
|
||||||
|
|
||||||
.PHONY: proto
|
.PHONY: proto-old
|
||||||
proto: bin/protoc-old bin/protoc-gen-go-old
|
proto-old: bin/protoc-old bin/protoc-gen-go-old
|
||||||
@./bin/protoc-old --go_out=plugins=grpc:. --plugin=protoc-gen-go=./bin/protoc-gen-go-old api/v2/*.proto
|
@./bin/protoc-old --go_out=plugins=grpc:. --plugin=protoc-gen-go=./bin/protoc-gen-go-old api/v2/*.proto
|
||||||
@cp api/v2/*.proto api/
|
@cp api/v2/*.proto api/
|
||||||
@./bin/protoc-old --go_out=plugins=grpc:. --plugin=protoc-gen-go=./bin/protoc-gen-go-old api/*.proto
|
@./bin/protoc-old --go_out=plugins=grpc:. --plugin=protoc-gen-go=./bin/protoc-gen-go-old api/*.proto
|
||||||
@ -121,6 +122,12 @@ FORCE:
|
|||||||
|
|
||||||
.PHONY: test testrace testall
|
.PHONY: test testrace testall
|
||||||
|
|
||||||
|
.PHONY: proto
|
||||||
|
proto: bin/protoc bin/protoc-gen-go bin/protoc-gen-go-grpc
|
||||||
|
@./bin/protoc --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. --plugin=protoc-gen-go=./bin/protoc-gen-go --plugin=protoc-gen-go-grpc=./bin/protoc-gen-go-grpc api/v2/*.proto
|
||||||
|
@./bin/protoc --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. --plugin=protoc-gen-go=./bin/protoc-gen-go --plugin=protoc-gen-go-grpc=./bin/protoc-gen-go-grpc api/*.proto
|
||||||
|
#@cp api/v2/*.proto api/
|
||||||
|
|
||||||
.PHONY: proto-internal
|
.PHONY: proto-internal
|
||||||
proto-internal: bin/protoc bin/protoc-gen-go
|
proto-internal: bin/protoc bin/protoc-gen-go
|
||||||
@./bin/protoc --go_out=paths=source_relative:. --plugin=protoc-gen-go=./bin/protoc-gen-go server/internal/*.proto
|
@./bin/protoc --go_out=paths=source_relative:. --plugin=protoc-gen-go=./bin/protoc-gen-go server/internal/*.proto
|
||||||
@ -143,3 +150,9 @@ bin/protoc-gen-go: bin/protoc-gen-go-${PROTOC_GEN_GO_VERSION}
|
|||||||
bin/protoc-gen-go-${PROTOC_GEN_GO_VERSION}:
|
bin/protoc-gen-go-${PROTOC_GEN_GO_VERSION}:
|
||||||
@mkdir -p bin
|
@mkdir -p bin
|
||||||
curl -L https://github.com/protocolbuffers/protobuf-go/releases/download/v${PROTOC_GEN_GO_VERSION}/protoc-gen-go.v${PROTOC_GEN_GO_VERSION}.${OS}.amd64.tar.gz | tar -zOxf - protoc-gen-go > ./bin/protoc-gen-go-${PROTOC_GEN_GO_VERSION} && chmod +x ./bin/protoc-gen-go-${PROTOC_GEN_GO_VERSION}
|
curl -L https://github.com/protocolbuffers/protobuf-go/releases/download/v${PROTOC_GEN_GO_VERSION}/protoc-gen-go.v${PROTOC_GEN_GO_VERSION}.${OS}.amd64.tar.gz | tar -zOxf - protoc-gen-go > ./bin/protoc-gen-go-${PROTOC_GEN_GO_VERSION} && chmod +x ./bin/protoc-gen-go-${PROTOC_GEN_GO_VERSION}
|
||||||
|
|
||||||
|
bin/protoc-gen-go-grpc: bin/protoc-gen-go-grpc-${PROTOC_GEN_GO_GRPC_VERSION}
|
||||||
|
@ln -sf protoc-gen-go-grpc-${PROTOC_GEN_GO_GRPC_VERSION} bin/protoc-gen-go-grpc
|
||||||
|
bin/protoc-gen-go-grpc-${PROTOC_GEN_GO_GRPC_VERSION}:
|
||||||
|
@mkdir -p bin
|
||||||
|
curl -L https://github.com/grpc/grpc-go/releases/download/cmd%2Fprotoc-gen-go-grpc%2Fv${PROTOC_GEN_GO_GRPC_VERSION}/protoc-gen-go-grpc.v${PROTOC_GEN_GO_GRPC_VERSION}.${OS}.amd64.tar.gz | tar -zOxf - ./protoc-gen-go-grpc > ./bin/protoc-gen-go-grpc-${PROTOC_GEN_GO_GRPC_VERSION} && chmod +x ./bin/protoc-gen-go-grpc-${PROTOC_GEN_GO_GRPC_VERSION}
|
||||||
|
2944
api/api.pb.go
2944
api/api.pb.go
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,10 @@
|
|||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
option java_package = "com.coreos.dex.api";
|
|
||||||
|
|
||||||
package api;
|
package api;
|
||||||
|
|
||||||
|
option java_package = "com.coreos.dex.api";
|
||||||
|
option go_package = "github.com/dexidp/dex/api";
|
||||||
|
|
||||||
// Client represents an OAuth2 client.
|
// Client represents an OAuth2 client.
|
||||||
message Client {
|
message Client {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
@ -22,7 +24,7 @@ message CreateClientReq {
|
|||||||
// CreateClientResp returns the response from creating a client.
|
// CreateClientResp returns the response from creating a client.
|
||||||
message CreateClientResp {
|
message CreateClientResp {
|
||||||
bool already_exists = 1;
|
bool already_exists = 1;
|
||||||
Client client = 2;
|
Client client = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteClientReq is a request to delete a client.
|
// DeleteClientReq is a request to delete a client.
|
||||||
@ -31,7 +33,7 @@ message DeleteClientReq {
|
|||||||
string id = 1;
|
string id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteClientResp determines if the client is deleted successfully.
|
// DeleteClientResp determines if the client is deleted successfully.
|
||||||
message DeleteClientResp {
|
message DeleteClientResp {
|
||||||
bool not_found = 1;
|
bool not_found = 1;
|
||||||
}
|
}
|
||||||
@ -80,7 +82,7 @@ message UpdatePasswordReq {
|
|||||||
string new_username = 3;
|
string new_username = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdatePasswordResp returns the response from modifying an existing password.
|
// UpdatePasswordResp returns the response from modifying an existing password.
|
||||||
message UpdatePasswordResp {
|
message UpdatePasswordResp {
|
||||||
bool not_found = 1;
|
bool not_found = 1;
|
||||||
}
|
}
|
||||||
@ -90,7 +92,7 @@ message DeletePasswordReq {
|
|||||||
string email = 1;
|
string email = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeletePasswordResp returns the response from deleting a password.
|
// DeletePasswordResp returns the response from deleting a password.
|
||||||
message DeletePasswordResp {
|
message DeletePasswordResp {
|
||||||
bool not_found = 1;
|
bool not_found = 1;
|
||||||
}
|
}
|
||||||
@ -142,7 +144,7 @@ message RevokeRefreshReq {
|
|||||||
string client_id = 2;
|
string client_id = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RevokeRefreshResp determines if the refresh token is revoked successfully.
|
// RevokeRefreshResp determines if the refresh token is revoked successfully.
|
||||||
message RevokeRefreshResp {
|
message RevokeRefreshResp {
|
||||||
// Set to true is refresh token was not found and token could not be revoked.
|
// Set to true is refresh token was not found and token could not be revoked.
|
||||||
bool not_found = 1;
|
bool not_found = 1;
|
||||||
|
487
api/api_grpc.pb.go
Normal file
487
api/api_grpc.pb.go
Normal file
@ -0,0 +1,487 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package api
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
// DexClient is the client API for Dex 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 DexClient interface {
|
||||||
|
// CreateClient creates a client.
|
||||||
|
CreateClient(ctx context.Context, in *CreateClientReq, opts ...grpc.CallOption) (*CreateClientResp, error)
|
||||||
|
// UpdateClient updates an existing client
|
||||||
|
UpdateClient(ctx context.Context, in *UpdateClientReq, opts ...grpc.CallOption) (*UpdateClientResp, error)
|
||||||
|
// DeleteClient deletes the provided client.
|
||||||
|
DeleteClient(ctx context.Context, in *DeleteClientReq, opts ...grpc.CallOption) (*DeleteClientResp, error)
|
||||||
|
// CreatePassword creates a password.
|
||||||
|
CreatePassword(ctx context.Context, in *CreatePasswordReq, opts ...grpc.CallOption) (*CreatePasswordResp, error)
|
||||||
|
// UpdatePassword modifies existing password.
|
||||||
|
UpdatePassword(ctx context.Context, in *UpdatePasswordReq, opts ...grpc.CallOption) (*UpdatePasswordResp, error)
|
||||||
|
// DeletePassword deletes the password.
|
||||||
|
DeletePassword(ctx context.Context, in *DeletePasswordReq, opts ...grpc.CallOption) (*DeletePasswordResp, error)
|
||||||
|
// ListPassword lists all password entries.
|
||||||
|
ListPasswords(ctx context.Context, in *ListPasswordReq, opts ...grpc.CallOption) (*ListPasswordResp, error)
|
||||||
|
// GetVersion returns version information of the server.
|
||||||
|
GetVersion(ctx context.Context, in *VersionReq, opts ...grpc.CallOption) (*VersionResp, error)
|
||||||
|
// ListRefresh lists all the refresh token entries for a particular user.
|
||||||
|
ListRefresh(ctx context.Context, in *ListRefreshReq, opts ...grpc.CallOption) (*ListRefreshResp, error)
|
||||||
|
// RevokeRefresh revokes the refresh token for the provided user-client pair.
|
||||||
|
//
|
||||||
|
// Note that each user-client pair can have only one refresh token at a time.
|
||||||
|
RevokeRefresh(ctx context.Context, in *RevokeRefreshReq, opts ...grpc.CallOption) (*RevokeRefreshResp, error)
|
||||||
|
// VerifyPassword returns whether a password matches a hash for a specific email or not.
|
||||||
|
VerifyPassword(ctx context.Context, in *VerifyPasswordReq, opts ...grpc.CallOption) (*VerifyPasswordResp, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type dexClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDexClient(cc grpc.ClientConnInterface) DexClient {
|
||||||
|
return &dexClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) CreateClient(ctx context.Context, in *CreateClientReq, opts ...grpc.CallOption) (*CreateClientResp, error) {
|
||||||
|
out := new(CreateClientResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/CreateClient", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) UpdateClient(ctx context.Context, in *UpdateClientReq, opts ...grpc.CallOption) (*UpdateClientResp, error) {
|
||||||
|
out := new(UpdateClientResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/UpdateClient", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) DeleteClient(ctx context.Context, in *DeleteClientReq, opts ...grpc.CallOption) (*DeleteClientResp, error) {
|
||||||
|
out := new(DeleteClientResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/DeleteClient", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) CreatePassword(ctx context.Context, in *CreatePasswordReq, opts ...grpc.CallOption) (*CreatePasswordResp, error) {
|
||||||
|
out := new(CreatePasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/CreatePassword", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) UpdatePassword(ctx context.Context, in *UpdatePasswordReq, opts ...grpc.CallOption) (*UpdatePasswordResp, error) {
|
||||||
|
out := new(UpdatePasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/UpdatePassword", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) DeletePassword(ctx context.Context, in *DeletePasswordReq, opts ...grpc.CallOption) (*DeletePasswordResp, error) {
|
||||||
|
out := new(DeletePasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/DeletePassword", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) ListPasswords(ctx context.Context, in *ListPasswordReq, opts ...grpc.CallOption) (*ListPasswordResp, error) {
|
||||||
|
out := new(ListPasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/ListPasswords", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) GetVersion(ctx context.Context, in *VersionReq, opts ...grpc.CallOption) (*VersionResp, error) {
|
||||||
|
out := new(VersionResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/GetVersion", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) ListRefresh(ctx context.Context, in *ListRefreshReq, opts ...grpc.CallOption) (*ListRefreshResp, error) {
|
||||||
|
out := new(ListRefreshResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/ListRefresh", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) RevokeRefresh(ctx context.Context, in *RevokeRefreshReq, opts ...grpc.CallOption) (*RevokeRefreshResp, error) {
|
||||||
|
out := new(RevokeRefreshResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/RevokeRefresh", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) VerifyPassword(ctx context.Context, in *VerifyPasswordReq, opts ...grpc.CallOption) (*VerifyPasswordResp, error) {
|
||||||
|
out := new(VerifyPasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/VerifyPassword", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DexServer is the server API for Dex service.
|
||||||
|
// All implementations must embed UnimplementedDexServer
|
||||||
|
// for forward compatibility
|
||||||
|
type DexServer interface {
|
||||||
|
// CreateClient creates a client.
|
||||||
|
CreateClient(context.Context, *CreateClientReq) (*CreateClientResp, error)
|
||||||
|
// UpdateClient updates an existing client
|
||||||
|
UpdateClient(context.Context, *UpdateClientReq) (*UpdateClientResp, error)
|
||||||
|
// DeleteClient deletes the provided client.
|
||||||
|
DeleteClient(context.Context, *DeleteClientReq) (*DeleteClientResp, error)
|
||||||
|
// CreatePassword creates a password.
|
||||||
|
CreatePassword(context.Context, *CreatePasswordReq) (*CreatePasswordResp, error)
|
||||||
|
// UpdatePassword modifies existing password.
|
||||||
|
UpdatePassword(context.Context, *UpdatePasswordReq) (*UpdatePasswordResp, error)
|
||||||
|
// DeletePassword deletes the password.
|
||||||
|
DeletePassword(context.Context, *DeletePasswordReq) (*DeletePasswordResp, error)
|
||||||
|
// ListPassword lists all password entries.
|
||||||
|
ListPasswords(context.Context, *ListPasswordReq) (*ListPasswordResp, error)
|
||||||
|
// GetVersion returns version information of the server.
|
||||||
|
GetVersion(context.Context, *VersionReq) (*VersionResp, error)
|
||||||
|
// ListRefresh lists all the refresh token entries for a particular user.
|
||||||
|
ListRefresh(context.Context, *ListRefreshReq) (*ListRefreshResp, error)
|
||||||
|
// RevokeRefresh revokes the refresh token for the provided user-client pair.
|
||||||
|
//
|
||||||
|
// Note that each user-client pair can have only one refresh token at a time.
|
||||||
|
RevokeRefresh(context.Context, *RevokeRefreshReq) (*RevokeRefreshResp, error)
|
||||||
|
// VerifyPassword returns whether a password matches a hash for a specific email or not.
|
||||||
|
VerifyPassword(context.Context, *VerifyPasswordReq) (*VerifyPasswordResp, error)
|
||||||
|
mustEmbedUnimplementedDexServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedDexServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedDexServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedDexServer) CreateClient(context.Context, *CreateClientReq) (*CreateClientResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CreateClient not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) UpdateClient(context.Context, *UpdateClientReq) (*UpdateClientResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateClient not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) DeleteClient(context.Context, *DeleteClientReq) (*DeleteClientResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteClient not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) CreatePassword(context.Context, *CreatePasswordReq) (*CreatePasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CreatePassword not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) UpdatePassword(context.Context, *UpdatePasswordReq) (*UpdatePasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdatePassword not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) DeletePassword(context.Context, *DeletePasswordReq) (*DeletePasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeletePassword not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) ListPasswords(context.Context, *ListPasswordReq) (*ListPasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListPasswords not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) GetVersion(context.Context, *VersionReq) (*VersionResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) ListRefresh(context.Context, *ListRefreshReq) (*ListRefreshResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListRefresh not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) RevokeRefresh(context.Context, *RevokeRefreshReq) (*RevokeRefreshResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method RevokeRefresh not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) VerifyPassword(context.Context, *VerifyPasswordReq) (*VerifyPasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method VerifyPassword not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) mustEmbedUnimplementedDexServer() {}
|
||||||
|
|
||||||
|
// UnsafeDexServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to DexServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeDexServer interface {
|
||||||
|
mustEmbedUnimplementedDexServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterDexServer(s grpc.ServiceRegistrar, srv DexServer) {
|
||||||
|
s.RegisterService(&Dex_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_CreateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateClientReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).CreateClient(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/CreateClient",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).CreateClient(ctx, req.(*CreateClientReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_UpdateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateClientReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).UpdateClient(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/UpdateClient",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).UpdateClient(ctx, req.(*UpdateClientReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_DeleteClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteClientReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).DeleteClient(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/DeleteClient",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).DeleteClient(ctx, req.(*DeleteClientReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_CreatePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreatePasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).CreatePassword(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/CreatePassword",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).CreatePassword(ctx, req.(*CreatePasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_UpdatePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdatePasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).UpdatePassword(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/UpdatePassword",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).UpdatePassword(ctx, req.(*UpdatePasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_DeletePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeletePasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).DeletePassword(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/DeletePassword",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).DeletePassword(ctx, req.(*DeletePasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_ListPasswords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListPasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).ListPasswords(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/ListPasswords",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).ListPasswords(ctx, req.(*ListPasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(VersionReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).GetVersion(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/GetVersion",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).GetVersion(ctx, req.(*VersionReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_ListRefresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListRefreshReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).ListRefresh(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/ListRefresh",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).ListRefresh(ctx, req.(*ListRefreshReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_RevokeRefresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(RevokeRefreshReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).RevokeRefresh(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/RevokeRefresh",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).RevokeRefresh(ctx, req.(*RevokeRefreshReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_VerifyPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(VerifyPasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).VerifyPassword(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/VerifyPassword",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).VerifyPassword(ctx, req.(*VerifyPasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dex_ServiceDesc is the grpc.ServiceDesc for Dex service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Dex_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "api.Dex",
|
||||||
|
HandlerType: (*DexServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "CreateClient",
|
||||||
|
Handler: _Dex_CreateClient_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateClient",
|
||||||
|
Handler: _Dex_UpdateClient_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteClient",
|
||||||
|
Handler: _Dex_DeleteClient_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CreatePassword",
|
||||||
|
Handler: _Dex_CreatePassword_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdatePassword",
|
||||||
|
Handler: _Dex_UpdatePassword_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeletePassword",
|
||||||
|
Handler: _Dex_DeletePassword_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListPasswords",
|
||||||
|
Handler: _Dex_ListPasswords_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetVersion",
|
||||||
|
Handler: _Dex_GetVersion_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListRefresh",
|
||||||
|
Handler: _Dex_ListRefresh_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "RevokeRefresh",
|
||||||
|
Handler: _Dex_RevokeRefresh_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "VerifyPassword",
|
||||||
|
Handler: _Dex_VerifyPassword_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "api/api.proto",
|
||||||
|
}
|
2945
api/v2/api.pb.go
2945
api/v2/api.pb.go
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,10 @@
|
|||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
option java_package = "com.coreos.dex.api";
|
|
||||||
|
|
||||||
package api;
|
package api;
|
||||||
|
|
||||||
|
option java_package = "com.coreos.dex.api";
|
||||||
|
option go_package = "github.com/dexidp/dex/api/v2;api";
|
||||||
|
|
||||||
// Client represents an OAuth2 client.
|
// Client represents an OAuth2 client.
|
||||||
message Client {
|
message Client {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
@ -22,7 +24,7 @@ message CreateClientReq {
|
|||||||
// CreateClientResp returns the response from creating a client.
|
// CreateClientResp returns the response from creating a client.
|
||||||
message CreateClientResp {
|
message CreateClientResp {
|
||||||
bool already_exists = 1;
|
bool already_exists = 1;
|
||||||
Client client = 2;
|
Client client = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteClientReq is a request to delete a client.
|
// DeleteClientReq is a request to delete a client.
|
||||||
@ -31,7 +33,7 @@ message DeleteClientReq {
|
|||||||
string id = 1;
|
string id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteClientResp determines if the client is deleted successfully.
|
// DeleteClientResp determines if the client is deleted successfully.
|
||||||
message DeleteClientResp {
|
message DeleteClientResp {
|
||||||
bool not_found = 1;
|
bool not_found = 1;
|
||||||
}
|
}
|
||||||
@ -80,7 +82,7 @@ message UpdatePasswordReq {
|
|||||||
string new_username = 3;
|
string new_username = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdatePasswordResp returns the response from modifying an existing password.
|
// UpdatePasswordResp returns the response from modifying an existing password.
|
||||||
message UpdatePasswordResp {
|
message UpdatePasswordResp {
|
||||||
bool not_found = 1;
|
bool not_found = 1;
|
||||||
}
|
}
|
||||||
@ -90,7 +92,7 @@ message DeletePasswordReq {
|
|||||||
string email = 1;
|
string email = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeletePasswordResp returns the response from deleting a password.
|
// DeletePasswordResp returns the response from deleting a password.
|
||||||
message DeletePasswordResp {
|
message DeletePasswordResp {
|
||||||
bool not_found = 1;
|
bool not_found = 1;
|
||||||
}
|
}
|
||||||
@ -142,7 +144,7 @@ message RevokeRefreshReq {
|
|||||||
string client_id = 2;
|
string client_id = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RevokeRefreshResp determines if the refresh token is revoked successfully.
|
// RevokeRefreshResp determines if the refresh token is revoked successfully.
|
||||||
message RevokeRefreshResp {
|
message RevokeRefreshResp {
|
||||||
// Set to true is refresh token was not found and token could not be revoked.
|
// Set to true is refresh token was not found and token could not be revoked.
|
||||||
bool not_found = 1;
|
bool not_found = 1;
|
||||||
|
487
api/v2/api_grpc.pb.go
Normal file
487
api/v2/api_grpc.pb.go
Normal file
@ -0,0 +1,487 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package api
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
// DexClient is the client API for Dex 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 DexClient interface {
|
||||||
|
// CreateClient creates a client.
|
||||||
|
CreateClient(ctx context.Context, in *CreateClientReq, opts ...grpc.CallOption) (*CreateClientResp, error)
|
||||||
|
// UpdateClient updates an existing client
|
||||||
|
UpdateClient(ctx context.Context, in *UpdateClientReq, opts ...grpc.CallOption) (*UpdateClientResp, error)
|
||||||
|
// DeleteClient deletes the provided client.
|
||||||
|
DeleteClient(ctx context.Context, in *DeleteClientReq, opts ...grpc.CallOption) (*DeleteClientResp, error)
|
||||||
|
// CreatePassword creates a password.
|
||||||
|
CreatePassword(ctx context.Context, in *CreatePasswordReq, opts ...grpc.CallOption) (*CreatePasswordResp, error)
|
||||||
|
// UpdatePassword modifies existing password.
|
||||||
|
UpdatePassword(ctx context.Context, in *UpdatePasswordReq, opts ...grpc.CallOption) (*UpdatePasswordResp, error)
|
||||||
|
// DeletePassword deletes the password.
|
||||||
|
DeletePassword(ctx context.Context, in *DeletePasswordReq, opts ...grpc.CallOption) (*DeletePasswordResp, error)
|
||||||
|
// ListPassword lists all password entries.
|
||||||
|
ListPasswords(ctx context.Context, in *ListPasswordReq, opts ...grpc.CallOption) (*ListPasswordResp, error)
|
||||||
|
// GetVersion returns version information of the server.
|
||||||
|
GetVersion(ctx context.Context, in *VersionReq, opts ...grpc.CallOption) (*VersionResp, error)
|
||||||
|
// ListRefresh lists all the refresh token entries for a particular user.
|
||||||
|
ListRefresh(ctx context.Context, in *ListRefreshReq, opts ...grpc.CallOption) (*ListRefreshResp, error)
|
||||||
|
// RevokeRefresh revokes the refresh token for the provided user-client pair.
|
||||||
|
//
|
||||||
|
// Note that each user-client pair can have only one refresh token at a time.
|
||||||
|
RevokeRefresh(ctx context.Context, in *RevokeRefreshReq, opts ...grpc.CallOption) (*RevokeRefreshResp, error)
|
||||||
|
// VerifyPassword returns whether a password matches a hash for a specific email or not.
|
||||||
|
VerifyPassword(ctx context.Context, in *VerifyPasswordReq, opts ...grpc.CallOption) (*VerifyPasswordResp, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type dexClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDexClient(cc grpc.ClientConnInterface) DexClient {
|
||||||
|
return &dexClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) CreateClient(ctx context.Context, in *CreateClientReq, opts ...grpc.CallOption) (*CreateClientResp, error) {
|
||||||
|
out := new(CreateClientResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/CreateClient", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) UpdateClient(ctx context.Context, in *UpdateClientReq, opts ...grpc.CallOption) (*UpdateClientResp, error) {
|
||||||
|
out := new(UpdateClientResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/UpdateClient", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) DeleteClient(ctx context.Context, in *DeleteClientReq, opts ...grpc.CallOption) (*DeleteClientResp, error) {
|
||||||
|
out := new(DeleteClientResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/DeleteClient", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) CreatePassword(ctx context.Context, in *CreatePasswordReq, opts ...grpc.CallOption) (*CreatePasswordResp, error) {
|
||||||
|
out := new(CreatePasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/CreatePassword", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) UpdatePassword(ctx context.Context, in *UpdatePasswordReq, opts ...grpc.CallOption) (*UpdatePasswordResp, error) {
|
||||||
|
out := new(UpdatePasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/UpdatePassword", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) DeletePassword(ctx context.Context, in *DeletePasswordReq, opts ...grpc.CallOption) (*DeletePasswordResp, error) {
|
||||||
|
out := new(DeletePasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/DeletePassword", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) ListPasswords(ctx context.Context, in *ListPasswordReq, opts ...grpc.CallOption) (*ListPasswordResp, error) {
|
||||||
|
out := new(ListPasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/ListPasswords", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) GetVersion(ctx context.Context, in *VersionReq, opts ...grpc.CallOption) (*VersionResp, error) {
|
||||||
|
out := new(VersionResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/GetVersion", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) ListRefresh(ctx context.Context, in *ListRefreshReq, opts ...grpc.CallOption) (*ListRefreshResp, error) {
|
||||||
|
out := new(ListRefreshResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/ListRefresh", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) RevokeRefresh(ctx context.Context, in *RevokeRefreshReq, opts ...grpc.CallOption) (*RevokeRefreshResp, error) {
|
||||||
|
out := new(RevokeRefreshResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/RevokeRefresh", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *dexClient) VerifyPassword(ctx context.Context, in *VerifyPasswordReq, opts ...grpc.CallOption) (*VerifyPasswordResp, error) {
|
||||||
|
out := new(VerifyPasswordResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/api.Dex/VerifyPassword", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DexServer is the server API for Dex service.
|
||||||
|
// All implementations must embed UnimplementedDexServer
|
||||||
|
// for forward compatibility
|
||||||
|
type DexServer interface {
|
||||||
|
// CreateClient creates a client.
|
||||||
|
CreateClient(context.Context, *CreateClientReq) (*CreateClientResp, error)
|
||||||
|
// UpdateClient updates an existing client
|
||||||
|
UpdateClient(context.Context, *UpdateClientReq) (*UpdateClientResp, error)
|
||||||
|
// DeleteClient deletes the provided client.
|
||||||
|
DeleteClient(context.Context, *DeleteClientReq) (*DeleteClientResp, error)
|
||||||
|
// CreatePassword creates a password.
|
||||||
|
CreatePassword(context.Context, *CreatePasswordReq) (*CreatePasswordResp, error)
|
||||||
|
// UpdatePassword modifies existing password.
|
||||||
|
UpdatePassword(context.Context, *UpdatePasswordReq) (*UpdatePasswordResp, error)
|
||||||
|
// DeletePassword deletes the password.
|
||||||
|
DeletePassword(context.Context, *DeletePasswordReq) (*DeletePasswordResp, error)
|
||||||
|
// ListPassword lists all password entries.
|
||||||
|
ListPasswords(context.Context, *ListPasswordReq) (*ListPasswordResp, error)
|
||||||
|
// GetVersion returns version information of the server.
|
||||||
|
GetVersion(context.Context, *VersionReq) (*VersionResp, error)
|
||||||
|
// ListRefresh lists all the refresh token entries for a particular user.
|
||||||
|
ListRefresh(context.Context, *ListRefreshReq) (*ListRefreshResp, error)
|
||||||
|
// RevokeRefresh revokes the refresh token for the provided user-client pair.
|
||||||
|
//
|
||||||
|
// Note that each user-client pair can have only one refresh token at a time.
|
||||||
|
RevokeRefresh(context.Context, *RevokeRefreshReq) (*RevokeRefreshResp, error)
|
||||||
|
// VerifyPassword returns whether a password matches a hash for a specific email or not.
|
||||||
|
VerifyPassword(context.Context, *VerifyPasswordReq) (*VerifyPasswordResp, error)
|
||||||
|
mustEmbedUnimplementedDexServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedDexServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedDexServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedDexServer) CreateClient(context.Context, *CreateClientReq) (*CreateClientResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CreateClient not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) UpdateClient(context.Context, *UpdateClientReq) (*UpdateClientResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateClient not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) DeleteClient(context.Context, *DeleteClientReq) (*DeleteClientResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteClient not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) CreatePassword(context.Context, *CreatePasswordReq) (*CreatePasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CreatePassword not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) UpdatePassword(context.Context, *UpdatePasswordReq) (*UpdatePasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdatePassword not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) DeletePassword(context.Context, *DeletePasswordReq) (*DeletePasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeletePassword not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) ListPasswords(context.Context, *ListPasswordReq) (*ListPasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListPasswords not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) GetVersion(context.Context, *VersionReq) (*VersionResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) ListRefresh(context.Context, *ListRefreshReq) (*ListRefreshResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListRefresh not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) RevokeRefresh(context.Context, *RevokeRefreshReq) (*RevokeRefreshResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method RevokeRefresh not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) VerifyPassword(context.Context, *VerifyPasswordReq) (*VerifyPasswordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method VerifyPassword not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDexServer) mustEmbedUnimplementedDexServer() {}
|
||||||
|
|
||||||
|
// UnsafeDexServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to DexServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeDexServer interface {
|
||||||
|
mustEmbedUnimplementedDexServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterDexServer(s grpc.ServiceRegistrar, srv DexServer) {
|
||||||
|
s.RegisterService(&Dex_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_CreateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateClientReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).CreateClient(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/CreateClient",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).CreateClient(ctx, req.(*CreateClientReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_UpdateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateClientReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).UpdateClient(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/UpdateClient",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).UpdateClient(ctx, req.(*UpdateClientReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_DeleteClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteClientReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).DeleteClient(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/DeleteClient",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).DeleteClient(ctx, req.(*DeleteClientReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_CreatePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreatePasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).CreatePassword(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/CreatePassword",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).CreatePassword(ctx, req.(*CreatePasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_UpdatePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdatePasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).UpdatePassword(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/UpdatePassword",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).UpdatePassword(ctx, req.(*UpdatePasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_DeletePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeletePasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).DeletePassword(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/DeletePassword",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).DeletePassword(ctx, req.(*DeletePasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_ListPasswords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListPasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).ListPasswords(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/ListPasswords",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).ListPasswords(ctx, req.(*ListPasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(VersionReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).GetVersion(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/GetVersion",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).GetVersion(ctx, req.(*VersionReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_ListRefresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListRefreshReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).ListRefresh(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/ListRefresh",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).ListRefresh(ctx, req.(*ListRefreshReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_RevokeRefresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(RevokeRefreshReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).RevokeRefresh(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/RevokeRefresh",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).RevokeRefresh(ctx, req.(*RevokeRefreshReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Dex_VerifyPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(VerifyPasswordReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DexServer).VerifyPassword(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/api.Dex/VerifyPassword",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DexServer).VerifyPassword(ctx, req.(*VerifyPasswordReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dex_ServiceDesc is the grpc.ServiceDesc for Dex service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Dex_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "api.Dex",
|
||||||
|
HandlerType: (*DexServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "CreateClient",
|
||||||
|
Handler: _Dex_CreateClient_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateClient",
|
||||||
|
Handler: _Dex_UpdateClient_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteClient",
|
||||||
|
Handler: _Dex_DeleteClient_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CreatePassword",
|
||||||
|
Handler: _Dex_CreatePassword_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdatePassword",
|
||||||
|
Handler: _Dex_UpdatePassword_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeletePassword",
|
||||||
|
Handler: _Dex_DeletePassword_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListPasswords",
|
||||||
|
Handler: _Dex_ListPasswords_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetVersion",
|
||||||
|
Handler: _Dex_GetVersion_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListRefresh",
|
||||||
|
Handler: _Dex_ListRefresh_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "RevokeRefresh",
|
||||||
|
Handler: _Dex_RevokeRefresh_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "VerifyPassword",
|
||||||
|
Handler: _Dex_VerifyPassword_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "api/v2/api.proto",
|
||||||
|
}
|
1
go.mod
1
go.mod
@ -11,7 +11,6 @@ require (
|
|||||||
github.com/ghodss/yaml v1.0.0
|
github.com/ghodss/yaml v1.0.0
|
||||||
github.com/go-ldap/ldap/v3 v3.2.4
|
github.com/go-ldap/ldap/v3 v3.2.4
|
||||||
github.com/go-sql-driver/mysql v1.5.0
|
github.com/go-sql-driver/mysql v1.5.0
|
||||||
github.com/golang/protobuf v1.5.0
|
|
||||||
github.com/gorilla/handlers v1.5.1
|
github.com/gorilla/handlers v1.5.1
|
||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
|
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
|
||||||
|
@ -38,6 +38,8 @@ func NewAPI(s storage.Storage, logger log.Logger) api.DexServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type dexAPI struct {
|
type dexAPI struct {
|
||||||
|
api.UnimplementedDexServer
|
||||||
|
|
||||||
s storage.Storage
|
s storage.Storage
|
||||||
logger log.Logger
|
logger log.Logger
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user