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
b65966d7
Unverified
Commit
b65966d7
authored
Aug 06, 2019
by
Michael Venezia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/dex: adding reflection to grpc api, enabled through configuration
parent
bc02006b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
api.md
Documentation/api.md
+3
-1
config.go
cmd/dex/config.go
+1
-0
serve.go
cmd/dex/serve.go
+5
-0
No files found.
Documentation/api.md
View file @
b65966d7
...
...
@@ -12,11 +12,13 @@ Admins that wish to expose the gRPC service must add the following entry to the
grpc:
# Cannot be the same address as an HTTP(S) service.
addr: 127.0.0.1:5557
# Server certs. If TLS credentials aren't provided dex will
generate self-signed ones
.
# Server certs. If TLS credentials aren't provided dex will
run in plaintext (HTTP) mode
.
tlsCert: /etc/dex/grpc.crt
tlsKey: /etc/dex/grpc.key
# Client auth CA.
tlsClientCA: /etc/dex/client.crt
# enable reflection
reflection: true
```
## Generating clients
...
...
cmd/dex/config.go
View file @
b65966d7
...
...
@@ -150,6 +150,7 @@ type GRPC struct {
TLSCert
string
`json:"tlsCert"`
TLSKey
string
`json:"tlsKey"`
TLSClientCA
string
`json:"tlsClientCA"`
Reflection
bool
`json:"reflection"`
}
// Storage holds app's storage configuration.
...
...
cmd/dex/serve.go
View file @
b65966d7
...
...
@@ -21,6 +21,7 @@ import (
"github.com/spf13/cobra"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/reflection"
"github.com/dexidp/dex/api"
"github.com/dexidp/dex/pkg/log"
...
...
@@ -282,6 +283,10 @@ func serve(cmd *cobra.Command, args []string) error {
s
:=
grpc
.
NewServer
(
grpcOptions
...
)
api
.
RegisterDexServer
(
s
,
server
.
NewAPI
(
serverConfig
.
Storage
,
logger
))
grpcMetrics
.
InitializeMetrics
(
s
)
if
c
.
GRPC
.
Reflection
{
logger
.
Info
(
"enabling reflection in grpc service"
)
reflection
.
Register
(
s
)
}
err
=
s
.
Serve
(
list
)
return
fmt
.
Errorf
(
"listening on %s failed: %v"
,
c
.
GRPC
.
Addr
,
err
)
}()
...
...
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