-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: read jwt subject to identify user
- jwt claim key is configurable under service.identity.namespace_claim_key Signed-off-by: Kush Sharma <[email protected]>
- Loading branch information
1 parent
7315deb
commit 6ef8571
Showing
9 changed files
with
110 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,8 @@ type IdentityConfig struct { | |
HeaderValueUserUUID string `yaml:"headervalue_uuid" mapstructure:"headervalue_uuid" default:"[email protected]"` | ||
HeaderKeyUserEmail string `yaml:"headerkey_email" mapstructure:"headerkey_email" default:"Compass-User-Email"` | ||
ProviderDefaultName string `yaml:"provider_default_name" mapstructure:"provider_default_name" default:""` | ||
|
||
NamespaceClaimKey string `yaml:"namespace_claim_key" mapstructure:"namespace_claim_key" default:"namespace_id"` | ||
} | ||
|
||
type GRPCConfig struct { | ||
|
@@ -100,8 +102,8 @@ func Serve( | |
grpc_logrus.UnaryServerInterceptor(logger.Entry()), | ||
nrgrpc.UnaryServerInterceptor(nrApp), | ||
grpc_interceptor.StatsD(statsdReporter), | ||
grpc_interceptor.NamespaceUnaryInterceptor(namespaceService, config.Identity.NamespaceClaimKey, config.Identity.HeaderKeyUserUUID), | ||
grpc_interceptor.UserHeaderCtx(config.Identity.HeaderKeyUserUUID, config.Identity.HeaderKeyUserEmail), | ||
grpc_interceptor.NamespaceUnaryInterceptor(namespaceService), | ||
)), | ||
) | ||
reflection.Register(grpcServer) | ||
|
Oops, something went wrong.