Skip to content

Commit

Permalink
Merge branch 'main' into expose-oauth-sdk-package
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethhealy authored Nov 25, 2024
2 parents 35e1374 + 98c5899 commit c7cca88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/schema/manifest.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"type": "string"
}
},
"required": ["type", "url", "protocol", "isEncrypted","mimeType"]
"required": ["type", "url", "protocol", "isEncrypted"]
},
"encryptionInformation": {
"type": "object",
Expand Down
9 changes: 9 additions & 0 deletions service/pkg/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"syscall"

"github.com/opentdf/platform/sdk"
"github.com/opentdf/platform/service/internal/auth"
"github.com/opentdf/platform/service/internal/config"
"github.com/opentdf/platform/service/internal/server"
"github.com/opentdf/platform/service/logger"
Expand Down Expand Up @@ -164,6 +165,14 @@ func Start(f ...StartOptions) error {
// If client credentials are provided, use them
if cfg.SDKConfig.ClientID != "" && cfg.SDKConfig.ClientSecret != "" {
sdkOptions = append(sdkOptions, sdk.WithClientCredentials(cfg.SDKConfig.ClientID, cfg.SDKConfig.ClientSecret, nil))

oidcconfig, err := auth.DiscoverOIDCConfiguration(ctx, cfg.Server.Auth.Issuer, logger)
if err != nil {
return fmt.Errorf("could not retrieve oidc configuration: %w", err)
}

// provide token endpoint -- sdk cannot discover it since well-known service isnt running yet
sdkOptions = append(sdkOptions, sdk.WithTokenEndpoint(oidcconfig.TokenEndpoint))
}

// If the mode is all, use IPC for the SDK client
Expand Down

0 comments on commit c7cca88

Please sign in to comment.