Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
de4e23a2
Commit
de4e23a2
authored
Nov 09, 2016
by
rithu john
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: add gRPC definition for version endpoint.
parent
36ade89e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
5 deletions
+31
-5
api.pb.go
api/api.pb.go
+0
-0
api.proto
api/api.proto
+19
-5
api.go
server/api.go
+12
-0
No files found.
api/api.pb.go
View file @
de4e23a2
This diff is collapsed.
Click to expand it.
api/api.proto
View file @
de4e23a2
...
...
@@ -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
)
{};
}
server/api.go
View file @
de4e23a2
...
...
@@ -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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment