Skip to content

Commit

Permalink
Add WebLogic to Orchestrator interface (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasjf authored Mar 8, 2024
1 parent f4be3f4 commit 370f2cf
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
20 changes: 12 additions & 8 deletions orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/strata-io/service-extension/secret"
"github.com/strata-io/service-extension/session"
"github.com/strata-io/service-extension/tai"
"github.com/strata-io/service-extension/weblogic"
)

type Orchestrator interface {
Expand All @@ -21,10 +22,6 @@ type Orchestrator interface {
// Session returns the session.
Session(opts ...session.SessionOpt) (session.Provider, error)

// Cache returns a cache that can be used to store state across different service
// extensions.
Cache(namespace string, opts ...cache.Constraint) (cache.Cache, error)

// SecretProvider gets a secret provider. An error is returned if a secret
// provider is not configured.
SecretProvider() (secret.Provider, error)
Expand All @@ -37,17 +34,20 @@ type Orchestrator interface {
// the attribute provider is not found.
AttributeProvider(name string) (idfabric.AttributeProvider, error)

// Metadata gets the metadata associated with the Service Extension in use.
Metadata() map[string]any

// Router gets a router.
Router() router.Router

// Metadata gets the metadata associated with the Service Extension in use.
Metadata() map[string]any
// App gets the App associated with the Service Extension in use.
App() (app.App, error)

// TAI gets a TAI provider.
TAI() tai.Provider

// App gets the App associated with the Service Extension in use.
App() (app.App, error)
// WebLogic gets a WebLogic provider.
WebLogic() weblogic.Provider

// Context gets the context associated with the Service Extension in use.
// This is an experimental feature and may not be available in all Service Extensions.
Expand All @@ -58,6 +58,10 @@ type Orchestrator interface {
// context.
WithContext(ctx context.Context) Orchestrator

// Cache returns a cache that can be used to store state across different service
// extensions.
Cache(namespace string, opts ...cache.Constraint) (cache.Cache, error)

// ServiceExtensionAssets exposes any assets that may have been bundled with the
// service extension.
ServiceExtensionAssets() bundle.SEAssets
Expand Down
26 changes: 26 additions & 0 deletions weblogic/weblogic.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package weblogic

import (
"time"
)

type Config struct {
// RSAPrivateKeyPEM is the pem-encoded RSA PKCS1 private key that will be used to
// sign the JWT.
RSAPrivateKeyPEM string

// Subject is the user's unique identifier. This value will be mapped to the
// JWT's 'sub' claim.
Subject string

// Lifetime is the duration of the token's lifetime. This value will be mapped
// to the JWT's 'exp' claim. The Lifetime should generally be set to match the
// lifetime of a user's session.
Lifetime time.Duration
}

type Provider interface {
// NewSignedJWT returns a signed JWT that the WebLogic Identity Asserter module
// will consume in order to build its identity context.
NewSignedJWT(Config) (string, error)
}

0 comments on commit 370f2cf

Please sign in to comment.