STS
kumolo implements a subset of the STS REST API. All operations accept standard AWS SDK v2 requests — point your client at http://localhost:5566.
Support levels
Section titled “Support levels”| Symbol | Meaning |
|---|---|
| ✓ | Fully implemented — the feature behaves like real AWS |
| ◐ | Partial support — the operation works but has known limitations; see the note for details |
| — | Not yet implemented |
Operation support
Section titled “Operation support”Operations sourced from internal/sts/handler.go in the kumolo repository.
| Operation | Supported |
|---|---|
GetCallerIdentity | ◐ |
AssumeRole | ◐ |
GetSessionToken | ◐ |
AssumeRoleWithWebIdentity | — |
AssumeRoleWithSAML | — |
GetFederationToken | — |
DecodeAuthorizationMessage | — |
GetAccessKeyInfo | — |
Quick start
Section titled “Quick start”import ( "context" "fmt"
"github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/service/sts")
cfg, err := config.LoadDefaultConfig(context.Background(), config.WithRegion("us-east-1"), config.WithCredentialsProvider( credentials.NewStaticCredentialsProvider("test", "test", ""), ),)if err != nil { panic(err)}
client := sts.NewFromConfig(cfg, func(o *sts.Options) { o.BaseEndpoint = aws.String("http://localhost:5566")})
identity, err := client.GetCallerIdentity(context.Background(), &sts.GetCallerIdentityInput{})if err != nil { panic(err)}fmt.Println("Account:", *identity.Account)fmt.Println("ARN: ", *identity.Arn)
role, err := client.AssumeRole(context.Background(), &sts.AssumeRoleInput{ RoleArn: aws.String("arn:aws:iam::000000000000:role/my-role"), RoleSessionName: aws.String("my-session"),})if err != nil { panic(err)}fmt.Println("AccessKeyId:", *role.Credentials.AccessKeyId)
token, err := client.GetSessionToken(context.Background(), &sts.GetSessionTokenInput{})if err != nil { panic(err)}fmt.Println("SessionToken:", *token.Credentials.SessionToken)import boto3
sts = boto3.client( "sts", region_name="us-east-1", endpoint_url="http://localhost:5566", aws_access_key_id="test", aws_secret_access_key="test",)
identity = sts.get_caller_identity()print("Account:", identity["Account"])print("ARN: ", identity["Arn"])
role = sts.assume_role( RoleArn="arn:aws:iam::000000000000:role/my-role", RoleSessionName="my-session",)print("AccessKeyId:", role["Credentials"]["AccessKeyId"])
token = sts.get_session_token()print("SessionToken:", token["Credentials"]["SessionToken"])aws sts get-caller-identity \ --endpoint-url http://localhost:5566 \ --region us-east-1
aws sts assume-role \ --role-arn arn:aws:iam::000000000000:role/my-role \ --role-session-name my-session \ --endpoint-url http://localhost:5566 \ --region us-east-1
aws sts get-session-token \ --endpoint-url http://localhost:5566 \ --region us-east-1