mirror of
https://github.com/storytold/irsa-manager.git
synced 2026-10-22 07:55:16 +00:00
factory rafactoring
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package selfhosted
|
||||
|
||||
import "context"
|
||||
|
||||
func Execute(ctx context.Context, factory OIDCIdPFactory) error {
|
||||
issuerMeta := factory.IssuerMeta()
|
||||
discovery := factory.IdPDiscovery()
|
||||
discoveryContents := factory.IdPDiscoveryContents(issuerMeta)
|
||||
idp, err := factory.IdP(issuerMeta)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = discovery.CreateStorage(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = discovery.Upload(ctx, discoveryContents)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = idp.Create(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user