Embed role policies in AssumeRole STS tokens (#8421)
* Embed role policies in AssumeRole STS tokens * Log STS policy lookup failures * Use IAMManager provider * Guard policy embedding role lookup
This commit is contained in:
@@ -47,6 +47,11 @@ type IAMIntegration interface {
|
||||
DefaultAllow() bool
|
||||
}
|
||||
|
||||
// IAMManagerProvider exposes the IAMManager backing an IAM integration.
|
||||
type IAMManagerProvider interface {
|
||||
GetIAMManager() *integration.IAMManager
|
||||
}
|
||||
|
||||
// S3IAMIntegration provides IAM integration for S3 API
|
||||
type S3IAMIntegration struct {
|
||||
iamManager *integration.IAMManager
|
||||
@@ -70,6 +75,11 @@ func NewS3IAMIntegration(iamManager *integration.IAMManager, filerAddress string
|
||||
}
|
||||
}
|
||||
|
||||
// GetIAMManager returns the IAMManager backing this integration.
|
||||
func (s3iam *S3IAMIntegration) GetIAMManager() *integration.IAMManager {
|
||||
return s3iam.iamManager
|
||||
}
|
||||
|
||||
// AuthenticateJWT authenticates JWT tokens using our STS service
|
||||
func (s3iam *S3IAMIntegration) AuthenticateJWT(ctx context.Context, r *http.Request) (*IAMIdentity, s3err.ErrorCode) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user