Skip to content

Commit

Permalink
fix ocm token
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Sep 13, 2024
1 parent ac26cd8 commit d26f39b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-ocm-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fixed the ocm tocken

We now pass the JWT secret to the reva runtime.

https://github.com/owncloud/ocis/pull/10050
1 change: 1 addition & 0 deletions services/ocm/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Config struct {
ServiceAccount ServiceAccount `yaml:"service_account"`
Events Events `yaml:"-"`

TokenManager *TokenManager `yaml:"token_manager"`
Reva *shared.Reva `yaml:"reva"`
OCMD OCMD `yaml:"ocmd"`
ScienceMesh ScienceMesh `yaml:"sciencemesh"`
Expand Down
8 changes: 8 additions & 0 deletions services/ocm/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ func EnsureDefaults(cfg *config.Config) {
cfg.Reva = structs.CopyOrZeroValue(cfg.Commons.Reva)
}

if cfg.TokenManager == nil && cfg.Commons != nil && cfg.Commons.TokenManager != nil {
cfg.TokenManager = &config.TokenManager{
JWTSecret: cfg.Commons.TokenManager.JWTSecret,
}
} else if cfg.TokenManager == nil {
cfg.TokenManager = &config.TokenManager{}
}

if cfg.GRPCClientTLS == nil && cfg.Commons != nil {
cfg.GRPCClientTLS = structs.CopyOrZeroValue(cfg.Commons.GRPCClientTLS)
}
Expand Down
1 change: 1 addition & 0 deletions services/ocm/pkg/revaconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]interface{} {
return map[string]interface{}{
"shared": map[string]interface{}{
"jwt_secret": cfg.TokenManager.JWTSecret,
"gatewaysvc": cfg.Reva.Address, // Todo or address?
"grpc_client_options": cfg.Reva.GetGRPCClientConfig(),
},
Expand Down

0 comments on commit d26f39b

Please sign in to comment.