mirror of
https://github.com/storytold/irsa-manager.git
synced 2026-10-28 08:47:48 +00:00
aws S3Client
This commit is contained in:
@@ -1,35 +1,12 @@
|
||||
package selfhosted
|
||||
|
||||
import "fmt"
|
||||
|
||||
type OIDCIdProvider interface {
|
||||
Discovery() string
|
||||
JWK() string
|
||||
Discovery() []byte
|
||||
JWK() []byte
|
||||
Endpoint() string
|
||||
}
|
||||
|
||||
type OIDCIdPCreator interface {
|
||||
CreateStorage() error
|
||||
Upload(o OIDCIdProvider) error
|
||||
CreateProvider() error
|
||||
}
|
||||
|
||||
type S3IdPCreator struct {
|
||||
region string
|
||||
bucketName string
|
||||
}
|
||||
|
||||
func (s *S3IdPCreator) CreateProvider() error {
|
||||
// create S3 Bucket // bucketName, Region
|
||||
// create OIDCProvider //
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *S3IdPCreator) Upload(o OIDCIdProvider) error {
|
||||
o.Discovery() // Upload to Endpoint()/.well-known/openid-configuration
|
||||
o.JWK() // Upload to Endpoint()/keys.json
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *S3IdPCreator) issuerHostPath() string {
|
||||
hostName := fmt.Sprintf("s3-%s.amazonaws.com", s.region)
|
||||
return fmt.Sprintf("%s/%s", hostName, s.bucketName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user