Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further improve usage as library #24

Open
IljaN opened this issue Feb 12, 2020 · 1 comment
Open

Further improve usage as library #24

IljaN opened this issue Feb 12, 2020 · 1 comment

Comments

@IljaN
Copy link
Contributor

IljaN commented Feb 12, 2020

As #19 is merged we would like to propose some follow up changes to further improve embedding.

Configuration files/keys

Instead of storing the path to the file the bootstrap should contain the unmarshaled config struct. With this change the consumer can decide how the load/un-marshall the config during the boot-process (etcd, hard-coded, different format). This would also decouple the business-logic from any io which should also improve test-ability.

This will require some concept on how to add extension-points to the bootstrap. (Extend interface introduced in #19 ?)

Assets (index.html)

Similar as above but here the path to index.html would be replaced by an io.reader of to allow loading assets from an vfs or do some other processing. Identifier-webapp should be optional as it might be hosted on another server.

@IljaN
Copy link
Contributor Author

IljaN commented Feb 12, 2020

Mockup to better bring the point across:

// Implementation of the bootstrap interface
type bootstrap struct {
	signInFormURI            *url.URL
	signedOutURI             *url.URL
	authorizationEndpointURI *url.URL
	endSessionEndpointURI    *url.URL

	tlsClientConfig *tls.Config

	issuerIdentifierURI        *url.URL
	identifierClient       	   *[]os.FileInfo   // !
	identifierRegistrationConf *clients.RegistryData // !
	identifierAuthoritiesConf  *authorities.Registry // !
	identifierScopesConf       *[]scopes.Definition // !

	encryptionSecret []byte
	signingMethod    jwt.SigningMethod
	signingKeyID     string
	signers          map[string]crypto.Signer
	validators       map[string]crypto.PublicKey

	accessTokenDurationSeconds uint64
	uriBasePath                string

	cfg      *config.Config
	managers *managers.Managers
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant