Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdacloud
dex
Commits
b65966d7
Unverified
Commit
b65966d7
authored
5 years ago
by
Michael Venezia
Browse files
Options
Downloads
Patches
Plain Diff
cmd/dex: adding reflection to grpc api, enabled through configuration
parent
bc02006b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Documentation/api.md
+3
-1
3 additions, 1 deletion
Documentation/api.md
cmd/dex/config.go
+1
-0
1 addition, 0 deletions
cmd/dex/config.go
cmd/dex/serve.go
+5
-0
5 additions, 0 deletions
cmd/dex/serve.go
with
9 additions
and
1 deletion
Documentation/api.md
+
3
−
1
View file @
b65966d7
...
@@ -12,11 +12,13 @@ Admins that wish to expose the gRPC service must add the following entry to the
...
@@ -12,11 +12,13 @@ Admins that wish to expose the gRPC service must add the following entry to the
grpc:
grpc:
# Cannot be the same address as an HTTP(S) service.
# Cannot be the same address as an HTTP(S) service.
addr: 127.0.0.1:5557
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
tlsCert: /etc/dex/grpc.crt
tlsKey: /etc/dex/grpc.key
tlsKey: /etc/dex/grpc.key
# Client auth CA.
# Client auth CA.
tlsClientCA: /etc/dex/client.crt
tlsClientCA: /etc/dex/client.crt
# enable reflection
reflection: true
```
```
## Generating clients
## Generating clients
...
...
This diff is collapsed.
Click to expand it.
cmd/dex/config.go
+
1
−
0
View file @
b65966d7
...
@@ -150,6 +150,7 @@ type GRPC struct {
...
@@ -150,6 +150,7 @@ type GRPC struct {
TLSCert
string
`json:"tlsCert"`
TLSCert
string
`json:"tlsCert"`
TLSKey
string
`json:"tlsKey"`
TLSKey
string
`json:"tlsKey"`
TLSClientCA
string
`json:"tlsClientCA"`
TLSClientCA
string
`json:"tlsClientCA"`
Reflection
bool
`json:"reflection"`
}
}
// Storage holds app's storage configuration.
// Storage holds app's storage configuration.
...
...
This diff is collapsed.
Click to expand it.
cmd/dex/serve.go
+
5
−
0
View file @
b65966d7
...
@@ -21,6 +21,7 @@ import (
...
@@ -21,6 +21,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"google.golang.org/grpc"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/reflection"
"github.com/dexidp/dex/api"
"github.com/dexidp/dex/api"
"github.com/dexidp/dex/pkg/log"
"github.com/dexidp/dex/pkg/log"
...
@@ -282,6 +283,10 @@ func serve(cmd *cobra.Command, args []string) error {
...
@@ -282,6 +283,10 @@ func serve(cmd *cobra.Command, args []string) error {
s
:=
grpc
.
NewServer
(
grpcOptions
...
)
s
:=
grpc
.
NewServer
(
grpcOptions
...
)
api
.
RegisterDexServer
(
s
,
server
.
NewAPI
(
serverConfig
.
Storage
,
logger
))
api
.
RegisterDexServer
(
s
,
server
.
NewAPI
(
serverConfig
.
Storage
,
logger
))
grpcMetrics
.
InitializeMetrics
(
s
)
grpcMetrics
.
InitializeMetrics
(
s
)
if
c
.
GRPC
.
Reflection
{
logger
.
Info
(
"enabling reflection in grpc service"
)
reflection
.
Register
(
s
)
}
err
=
s
.
Serve
(
list
)
err
=
s
.
Serve
(
list
)
return
fmt
.
Errorf
(
"listening on %s failed: %v"
,
c
.
GRPC
.
Addr
,
err
)
return
fmt
.
Errorf
(
"listening on %s failed: %v"
,
c
.
GRPC
.
Addr
,
err
)
}()
}()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment