mirror of
https://github.com/storytold/irsa-manager.git
synced 2026-10-09 00:09:43 +00:00
secret deletion
This commit is contained in:
@@ -11,6 +11,7 @@ type OIDCIdP interface {
|
||||
Create(ctx context.Context) (string, error)
|
||||
IsUpdate() (bool, error)
|
||||
Update(ctx context.Context) error
|
||||
Delete(ctx context.Context) error
|
||||
}
|
||||
|
||||
type OIDCIdPDiscoveryContents interface {
|
||||
@@ -22,6 +23,7 @@ type OIDCIdPDiscoveryContents interface {
|
||||
type OIDCIdPDiscovery interface {
|
||||
CreateStorage(ctx context.Context) error
|
||||
Upload(ctx context.Context, o OIDCIdPDiscoveryContents) error
|
||||
DeleteStorage(ctx context.Context) error
|
||||
}
|
||||
|
||||
type OIDCIdPFactory interface {
|
||||
|
||||
@@ -32,3 +32,8 @@ func (a *AwsIdP) Update(ctx context.Context) error {
|
||||
func (a *AwsIdP) IsUpdate() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (a *AwsIdP) Delete(ctx context.Context) error {
|
||||
// TODO:
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -59,3 +59,9 @@ func (s *S3IdPDiscovery) Upload(ctx context.Context, o selfhosted.OIDCIdPDiscove
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteStorage delete an S3 bucket
|
||||
func (s *S3IdPDiscovery) DeleteStorage(ctx context.Context) error {
|
||||
// TODO:
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -24,3 +24,21 @@ func Execute(ctx context.Context, factory OIDCIdPFactory) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Delete(ctx context.Context, factory OIDCIdPFactory) error {
|
||||
issuerMeta := factory.IssuerMeta()
|
||||
discovery := factory.IdPDiscovery()
|
||||
idp, err := factory.IdP(issuerMeta)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = discovery.DeleteStorage(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = idp.Delete(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user