forked from mystiq/dex
Merge pull request #683 from rithujohn191/add-version-endpoint
api: add gRPC definition for version endpoint.
This commit is contained in:
commit
e1f6679107
3 changed files with 141 additions and 49 deletions
154
api/api.pb.go
154
api/api.pb.go
|
@ -21,6 +21,8 @@ It has these top-level messages:
|
|||
UpdatePasswordResp
|
||||
DeletePasswordReq
|
||||
DeletePasswordResp
|
||||
VersionReq
|
||||
VersionResp
|
||||
*/
|
||||
package api
|
||||
|
||||
|
@ -200,6 +202,29 @@ func (m *DeletePasswordResp) String() string { return proto.CompactTe
|
|||
func (*DeletePasswordResp) ProtoMessage() {}
|
||||
func (*DeletePasswordResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
|
||||
|
||||
// VersionReq is a request to fetch version info.
|
||||
type VersionReq struct {
|
||||
}
|
||||
|
||||
func (m *VersionReq) Reset() { *m = VersionReq{} }
|
||||
func (m *VersionReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*VersionReq) ProtoMessage() {}
|
||||
func (*VersionReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }
|
||||
|
||||
// VersionResp holds the version info of components.
|
||||
type VersionResp struct {
|
||||
// Semantic version of the server.
|
||||
Server string `protobuf:"bytes,1,opt,name=server" json:"server,omitempty"`
|
||||
// Numeric version of the API. It increases everytime a new call is added to the API.
|
||||
// Clients should use this info to determine if the server supports specific features.
|
||||
Api int32 `protobuf:"varint,2,opt,name=api" json:"api,omitempty"`
|
||||
}
|
||||
|
||||
func (m *VersionResp) Reset() { *m = VersionResp{} }
|
||||
func (m *VersionResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*VersionResp) ProtoMessage() {}
|
||||
func (*VersionResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} }
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Client)(nil), "api.Client")
|
||||
proto.RegisterType((*CreateClientReq)(nil), "api.CreateClientReq")
|
||||
|
@ -213,6 +238,8 @@ func init() {
|
|||
proto.RegisterType((*UpdatePasswordResp)(nil), "api.UpdatePasswordResp")
|
||||
proto.RegisterType((*DeletePasswordReq)(nil), "api.DeletePasswordReq")
|
||||
proto.RegisterType((*DeletePasswordResp)(nil), "api.DeletePasswordResp")
|
||||
proto.RegisterType((*VersionReq)(nil), "api.VersionReq")
|
||||
proto.RegisterType((*VersionResp)(nil), "api.VersionResp")
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
@ -226,16 +253,18 @@ const _ = grpc.SupportPackageIsVersion3
|
|||
// Client API for Dex service
|
||||
|
||||
type DexClient interface {
|
||||
// CreateClient attempts to create the client.
|
||||
// CreateClient creates a client.
|
||||
CreateClient(ctx context.Context, in *CreateClientReq, opts ...grpc.CallOption) (*CreateClientResp, error)
|
||||
// DeleteClient attempts to delete the provided client.
|
||||
// DeleteClient deletes the provided client.
|
||||
DeleteClient(ctx context.Context, in *DeleteClientReq, opts ...grpc.CallOption) (*DeleteClientResp, error)
|
||||
// CreatePassword attempts to create the password.
|
||||
// CreatePassword creates a password.
|
||||
CreatePassword(ctx context.Context, in *CreatePasswordReq, opts ...grpc.CallOption) (*CreatePasswordResp, error)
|
||||
// UpdatePassword attempts to modify existing password.
|
||||
// UpdatePassword modifies existing password.
|
||||
UpdatePassword(ctx context.Context, in *UpdatePasswordReq, opts ...grpc.CallOption) (*UpdatePasswordResp, error)
|
||||
// DeletePassword attempts to delete the password.
|
||||
// DeletePassword deletes the password.
|
||||
DeletePassword(ctx context.Context, in *DeletePasswordReq, opts ...grpc.CallOption) (*DeletePasswordResp, error)
|
||||
// GetVersion returns version information of the server.
|
||||
GetVersion(ctx context.Context, in *VersionReq, opts ...grpc.CallOption) (*VersionResp, error)
|
||||
}
|
||||
|
||||
type dexClient struct {
|
||||
|
@ -291,19 +320,30 @@ func (c *dexClient) DeletePassword(ctx context.Context, in *DeletePasswordReq, o
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *dexClient) GetVersion(ctx context.Context, in *VersionReq, opts ...grpc.CallOption) (*VersionResp, error) {
|
||||
out := new(VersionResp)
|
||||
err := grpc.Invoke(ctx, "/api.Dex/GetVersion", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Dex service
|
||||
|
||||
type DexServer interface {
|
||||
// CreateClient attempts to create the client.
|
||||
// CreateClient creates a client.
|
||||
CreateClient(context.Context, *CreateClientReq) (*CreateClientResp, error)
|
||||
// DeleteClient attempts to delete the provided client.
|
||||
// DeleteClient deletes the provided client.
|
||||
DeleteClient(context.Context, *DeleteClientReq) (*DeleteClientResp, error)
|
||||
// CreatePassword attempts to create the password.
|
||||
// CreatePassword creates a password.
|
||||
CreatePassword(context.Context, *CreatePasswordReq) (*CreatePasswordResp, error)
|
||||
// UpdatePassword attempts to modify existing password.
|
||||
// UpdatePassword modifies existing password.
|
||||
UpdatePassword(context.Context, *UpdatePasswordReq) (*UpdatePasswordResp, error)
|
||||
// DeletePassword attempts to delete the password.
|
||||
// DeletePassword deletes the password.
|
||||
DeletePassword(context.Context, *DeletePasswordReq) (*DeletePasswordResp, error)
|
||||
// GetVersion returns version information of the server.
|
||||
GetVersion(context.Context, *VersionReq) (*VersionResp, error)
|
||||
}
|
||||
|
||||
func RegisterDexServer(s *grpc.Server, srv DexServer) {
|
||||
|
@ -400,6 +440,24 @@ func _Dex_DeletePassword_Handler(srv interface{}, ctx context.Context, dec func(
|
|||
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)
|
||||
}
|
||||
|
||||
var _Dex_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "api.Dex",
|
||||
HandlerType: (*DexServer)(nil),
|
||||
|
@ -424,6 +482,10 @@ var _Dex_serviceDesc = grpc.ServiceDesc{
|
|||
MethodName: "DeletePassword",
|
||||
Handler: _Dex_DeletePassword_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetVersion",
|
||||
Handler: _Dex_GetVersion_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: fileDescriptor0,
|
||||
|
@ -432,38 +494,42 @@ var _Dex_serviceDesc = grpc.ServiceDesc{
|
|||
func init() { proto.RegisterFile("api/api.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 527 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x54, 0xcb, 0x6e, 0xdb, 0x30,
|
||||
0x10, 0x8c, 0x1f, 0xb1, 0xe5, 0xf5, 0x23, 0x31, 0x91, 0x26, 0x8a, 0x7b, 0x71, 0x18, 0x14, 0x70,
|
||||
0x2e, 0x09, 0x9a, 0x02, 0xbd, 0x14, 0xed, 0xc5, 0x69, 0xd1, 0xde, 0x02, 0x01, 0xbe, 0x56, 0x60,
|
||||
0xcc, 0x6d, 0x42, 0x40, 0x91, 0x58, 0x92, 0x82, 0xd3, 0xcf, 0xeb, 0x2f, 0xf4, 0x8b, 0x0a, 0x52,
|
||||
0xb4, 0x21, 0xc9, 0x2e, 0xdc, 0x9b, 0x66, 0xb8, 0x9c, 0xe5, 0xcc, 0x2e, 0x04, 0x43, 0x26, 0xc5,
|
||||
0x0d, 0x93, 0xe2, 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09,
|
||||
0xad, 0x3b, 0x7c, 0x21, 0x1f, 0x61, 0x50, 0xde, 0x4e, 0x72, 0x52, 0xac, 0x58, 0x75, 0xd1, 0x27,
|
||||
0xaf, 0x76, 0xb0, 0x5a, 0xd2, 0x03, 0x7b, 0xbd, 0xbc, 0x59, 0xfe, 0x7a, 0x6d, 0x1f, 0xfd, 0xf5,
|
||||
0xfa, 0x0a, 0xd2, 0x03, 0x32, 0x87, 0x51, 0x75, 0x78, 0xe4, 0xb4, 0xd4, 0xa9, 0x64, 0x7c, 0x72,
|
||||
0xb6, 0x93, 0x5f, 0x8b, 0x54, 0xb3, 0xf5, 0x22, 0x5b, 0x93, 0xf5, 0x22, 0xdb, 0x83, 0x28, 0x44,
|
||||
0xaa, 0x11, 0x7a, 0x91, 0xad, 0x11, 0x78, 0x91, 0xed, 0xbc, 0xe9, 0xc1, 0x43, 0xc7, 0xfd, 0xf2,
|
||||
0xde, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x63, 0xfb, 0xcd, 0x93, 0x03, 0x05, 0x00, 0x00,
|
||||
// 579 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x54, 0xcb, 0x6e, 0xdb, 0x3a,
|
||||
0x10, 0x8d, 0x2d, 0x3f, 0xe4, 0xf1, 0x9b, 0xc8, 0x4d, 0x14, 0xdf, 0x8d, 0xc3, 0xa0, 0x80, 0xb3,
|
||||
0x49, 0x90, 0x14, 0x68, 0x17, 0x45, 0xbb, 0x71, 0xfa, 0xda, 0x05, 0x02, 0xdc, 0x65, 0x05, 0xc5,
|
||||
0x9a, 0x26, 0x04, 0x14, 0x89, 0x21, 0xa9, 0x3a, 0xfd, 0x80, 0x7e, 0x58, 0xff, 0xac, 0x20, 0x45,
|
||||
0xbb, 0x92, 0xec, 0xc2, 0xdd, 0xf1, 0x1c, 0xce, 0x9c, 0xd1, 0xcc, 0x19, 0x0a, 0xfa, 0x21, 0x67,
|
||||
0x97, 0x21, 0x67, 0x17, 0x5c, 0xa4, 0x2a, 0x25, 0x4e, 0xc8, 0x19, 0xfd, 0x55, 0x83, 0xd6, 0x3c,
|
||||
0x66, 0x98, 0x28, 0x32, 0x80, 0x3a, 0x8b, 0xbc, 0xda, 0xb4, 0x36, 0xeb, 0xf8, 0x75, 0x16, 0x91,
|
||||
0x23, 0x68, 0x49, 0x5c, 0x0a, 0x54, 0x5e, 0xdd, 0x70, 0x16, 0x91, 0x33, 0xe8, 0x0b, 0x8c, 0x98,
|
||||
0xc0, 0xa5, 0x0a, 0x32, 0xc1, 0xa4, 0xe7, 0x4c, 0x9d, 0x59, 0xc7, 0xef, 0xad, 0xc9, 0x85, 0x60,
|
||||
0x52, 0x07, 0x29, 0x91, 0x49, 0x85, 0x51, 0xc0, 0x11, 0x85, 0xf4, 0x1a, 0x79, 0x90, 0x25, 0x6f,
|
||||
0x35, 0xa7, 0x2b, 0xf0, 0xec, 0x2e, 0x66, 0x4b, 0xaf, 0x39, 0xad, 0xcd, 0x5c, 0xdf, 0x22, 0x42,
|
||||
0xa0, 0x91, 0x84, 0x8f, 0xe8, 0xb5, 0x4c, 0x5d, 0x73, 0x26, 0x27, 0xe0, 0xc6, 0xe9, 0x7d, 0x1a,
|
||||
0x64, 0x22, 0xf6, 0xda, 0x86, 0x6f, 0x6b, 0xbc, 0x10, 0x31, 0x7d, 0x05, 0xc3, 0xb9, 0xc0, 0x50,
|
||||
0x61, 0xde, 0x88, 0x8f, 0x4f, 0xe4, 0x0c, 0x5a, 0x4b, 0x03, 0x4c, 0x3f, 0xdd, 0xeb, 0xee, 0x85,
|
||||
0xee, 0xdb, 0xde, 0xdb, 0x2b, 0xfa, 0x15, 0x46, 0xe5, 0x3c, 0xc9, 0xc9, 0x0b, 0x18, 0x84, 0xb1,
|
||||
0xc0, 0x30, 0xfa, 0x11, 0xe0, 0x33, 0x93, 0x4a, 0x1a, 0x01, 0xd7, 0x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0xea, 0xd5, 0xd0, 0x7d, 0xea, 0x3d,
|
||||
0x80, 0x2f, 0x28, 0x24, 0x4b, 0x13, 0x1f, 0x9f, 0xe8, 0x6b, 0xe8, 0x6e, 0x90, 0xe4, 0xf9, 0x9b,
|
||||
0x14, 0xdf, 0x51, 0xd8, 0x32, 0x16, 0x91, 0x11, 0xe8, 0xd7, 0x6c, 0xda, 0x6f, 0xfa, 0xfa, 0x78,
|
||||
0xfd, 0xd3, 0x01, 0xe7, 0x06, 0x9f, 0xc9, 0x5b, 0xe8, 0x15, 0x97, 0x9c, 0x1c, 0xe6, 0x9b, 0x5a,
|
||||
0x7e, 0x2f, 0x93, 0xff, 0x76, 0xb0, 0x92, 0xd3, 0x03, 0x9d, 0x5e, 0x5c, 0x50, 0x9b, 0x5e, 0x59,
|
||||
0x6b, 0x9b, 0x5e, 0xdd, 0x64, 0x7a, 0x40, 0xe6, 0x30, 0x28, 0xef, 0x00, 0x39, 0x2a, 0x54, 0x2a,
|
||||
0xcc, 0x6f, 0x72, 0xbc, 0x93, 0x5f, 0x8b, 0x94, 0x2d, 0xb2, 0x22, 0x5b, 0x0b, 0x62, 0x45, 0xb6,
|
||||
0xfd, 0xcc, 0x45, 0xca, 0x4e, 0x58, 0x91, 0x2d, 0x27, 0xad, 0xc8, 0xb6, 0x6d, 0xf4, 0x80, 0x5c,
|
||||
0x01, 0x7c, 0x44, 0x65, 0x0d, 0x21, 0x43, 0x13, 0xf8, 0xc7, 0xac, 0xc9, 0xa8, 0x4c, 0xe8, 0x94,
|
||||
0xbb, 0x96, 0xf9, 0xd9, 0xbe, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x72, 0xb9, 0x88, 0x7f, 0x7d,
|
||||
0x05, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
@ -80,16 +80,30 @@ message DeletePasswordResp {
|
|||
bool not_found = 1;
|
||||
}
|
||||
|
||||
// VersionReq is a request to fetch version info.
|
||||
message VersionReq {}
|
||||
|
||||
// VersionResp holds the version info of components.
|
||||
message VersionResp {
|
||||
// Semantic version of the server.
|
||||
string server = 1;
|
||||
// Numeric version of the API. It increases everytime a new call is added to the API.
|
||||
// Clients should use this info to determine if the server supports specific features.
|
||||
int32 api = 2;
|
||||
}
|
||||
|
||||
// Dex represents the dex gRPC service.
|
||||
service Dex {
|
||||
// CreateClient attempts to create the client.
|
||||
// CreateClient creates a client.
|
||||
rpc CreateClient(CreateClientReq) returns (CreateClientResp) {};
|
||||
// DeleteClient attempts to delete the provided client.
|
||||
// DeleteClient deletes the provided client.
|
||||
rpc DeleteClient(DeleteClientReq) returns (DeleteClientResp) {};
|
||||
// CreatePassword attempts to create the password.
|
||||
// CreatePassword creates a password.
|
||||
rpc CreatePassword(CreatePasswordReq) returns (CreatePasswordResp) {};
|
||||
// UpdatePassword attempts to modify existing password.
|
||||
// UpdatePassword modifies existing password.
|
||||
rpc UpdatePassword(UpdatePasswordReq) returns (UpdatePasswordResp) {};
|
||||
// DeletePassword attempts to delete the password.
|
||||
// DeletePassword deletes the password.
|
||||
rpc DeletePassword(DeletePasswordReq) returns (DeletePasswordResp) {};
|
||||
// GetVersion returns version information of the server.
|
||||
rpc GetVersion(VersionReq) returns (VersionResp) {};
|
||||
}
|
||||
|
|
|
@ -10,8 +10,13 @@ import (
|
|||
|
||||
"github.com/coreos/dex/api"
|
||||
"github.com/coreos/dex/storage"
|
||||
"github.com/coreos/dex/version"
|
||||
)
|
||||
|
||||
// apiVersion increases everytime a new call is added to the API. Clients should use this info
|
||||
// to determine if the server supports specific features.
|
||||
const apiVersion = 0
|
||||
|
||||
// NewAPI returns a server which implements the gRPC API interface.
|
||||
func NewAPI(s storage.Storage) api.DexServer {
|
||||
return dexAPI{s: s}
|
||||
|
@ -159,3 +164,10 @@ func (d dexAPI) DeletePassword(ctx context.Context, req *api.DeletePasswordReq)
|
|||
return &api.DeletePasswordResp{}, nil
|
||||
|
||||
}
|
||||
|
||||
func (d dexAPI) GetVersion(ctx context.Context, req *api.VersionReq) (*api.VersionResp, error) {
|
||||
return &api.VersionResp{
|
||||
Server: version.Version,
|
||||
Api: apiVersion,
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue