mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-10-19 13:49:53 +00:00
b2ae48dc2d
Bumps the github-dependencies group with 5 updates: | Package | From | To | | --- | --- | --- | | [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | `1.49.0` | `1.49.13` | | [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) | `1.26.5` | `1.26.6` | | [github.com/google/uuid](https://github.com/google/uuid) | `1.4.0` | `1.5.0` | | [github.com/kubernetes-csi/csi-lib-utils](https://github.com/kubernetes-csi/csi-lib-utils) | `0.14.0` | `0.17.0` | | [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) | `1.17.0` | `1.18.0` | Updates `github.com/aws/aws-sdk-go` from 1.49.0 to 1.49.13 - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.49.0...v1.49.13) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.26.5 to 1.26.6 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.26.5...service/s3/v1.26.6) Updates `github.com/google/uuid` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/google/uuid/releases) - [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) Updates `github.com/kubernetes-csi/csi-lib-utils` from 0.14.0 to 0.17.0 - [Release notes](https://github.com/kubernetes-csi/csi-lib-utils/releases) - [Commits](https://github.com/kubernetes-csi/csi-lib-utils/compare/v0.14.0...v0.17.0) Updates `github.com/prometheus/client_golang` from 1.17.0 to 1.18.0 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.17.0...v1.18.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies - dependency-name: github.com/google/uuid dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/kubernetes-csi/csi-lib-utils dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
513 lines
14 KiB
Go
513 lines
14 KiB
Go
// Code generated by smithy-go-codegen DO NOT EDIT.
|
|
|
|
package endpoints
|
|
|
|
import (
|
|
"github.com/aws/aws-sdk-go-v2/aws"
|
|
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
|
|
"github.com/aws/smithy-go/logging"
|
|
"regexp"
|
|
)
|
|
|
|
// Options is the endpoint resolver configuration options
|
|
type Options struct {
|
|
// Logger is a logging implementation that log events should be sent to.
|
|
Logger logging.Logger
|
|
|
|
// LogDeprecated indicates that deprecated endpoints should be logged to the
|
|
// provided logger.
|
|
LogDeprecated bool
|
|
|
|
// ResolvedRegion is used to override the region to be resolved, rather then the
|
|
// using the value passed to the ResolveEndpoint method. This value is used by the
|
|
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
|
|
// name. You must not set this value directly in your application.
|
|
ResolvedRegion string
|
|
|
|
// DisableHTTPS informs the resolver to return an endpoint that does not use the
|
|
// HTTPS scheme.
|
|
DisableHTTPS bool
|
|
|
|
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
|
|
UseDualStackEndpoint aws.DualStackEndpointState
|
|
|
|
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
|
|
UseFIPSEndpoint aws.FIPSEndpointState
|
|
}
|
|
|
|
func (o Options) GetResolvedRegion() string {
|
|
return o.ResolvedRegion
|
|
}
|
|
|
|
func (o Options) GetDisableHTTPS() bool {
|
|
return o.DisableHTTPS
|
|
}
|
|
|
|
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
|
|
return o.UseDualStackEndpoint
|
|
}
|
|
|
|
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
|
|
return o.UseFIPSEndpoint
|
|
}
|
|
|
|
func transformToSharedOptions(options Options) endpoints.Options {
|
|
return endpoints.Options{
|
|
Logger: options.Logger,
|
|
LogDeprecated: options.LogDeprecated,
|
|
ResolvedRegion: options.ResolvedRegion,
|
|
DisableHTTPS: options.DisableHTTPS,
|
|
UseDualStackEndpoint: options.UseDualStackEndpoint,
|
|
UseFIPSEndpoint: options.UseFIPSEndpoint,
|
|
}
|
|
}
|
|
|
|
// Resolver STS endpoint resolver
|
|
type Resolver struct {
|
|
partitions endpoints.Partitions
|
|
}
|
|
|
|
// ResolveEndpoint resolves the service endpoint for the given region and options
|
|
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
|
|
if len(region) == 0 {
|
|
return endpoint, &aws.MissingRegionError{}
|
|
}
|
|
|
|
opt := transformToSharedOptions(options)
|
|
return r.partitions.ResolveEndpoint(region, opt)
|
|
}
|
|
|
|
// New returns a new Resolver
|
|
func New() *Resolver {
|
|
return &Resolver{
|
|
partitions: defaultPartitions,
|
|
}
|
|
}
|
|
|
|
var partitionRegexp = struct {
|
|
Aws *regexp.Regexp
|
|
AwsCn *regexp.Regexp
|
|
AwsIso *regexp.Regexp
|
|
AwsIsoB *regexp.Regexp
|
|
AwsIsoE *regexp.Regexp
|
|
AwsIsoF *regexp.Regexp
|
|
AwsUsGov *regexp.Regexp
|
|
}{
|
|
|
|
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"),
|
|
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
|
|
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
|
|
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
|
|
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
|
|
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
|
|
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
|
|
}
|
|
|
|
var defaultPartitions = endpoints.Partitions{
|
|
{
|
|
ID: "aws",
|
|
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
|
{
|
|
Variant: endpoints.DualStackVariant,
|
|
}: {
|
|
Hostname: "sts.{region}.api.aws",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.{region}.amazonaws.com",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
|
}: {
|
|
Hostname: "sts-fips.{region}.api.aws",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: 0,
|
|
}: {
|
|
Hostname: "sts.{region}.amazonaws.com",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
},
|
|
RegionRegex: partitionRegexp.Aws,
|
|
IsRegionalized: true,
|
|
Endpoints: endpoints.Endpoints{
|
|
endpoints.EndpointKey{
|
|
Region: "af-south-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-east-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-northeast-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-northeast-2",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-northeast-3",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-south-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-south-2",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-southeast-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-southeast-2",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-southeast-3",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ap-southeast-4",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "aws-global",
|
|
}: endpoints.Endpoint{
|
|
Hostname: "sts.amazonaws.com",
|
|
CredentialScope: endpoints.CredentialScope{
|
|
Region: "us-east-1",
|
|
},
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "ca-central-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "ca-west-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "eu-central-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "eu-central-2",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "eu-north-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "eu-south-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "eu-south-2",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "eu-west-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "eu-west-2",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "eu-west-3",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "il-central-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "me-central-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "me-south-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "sa-east-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "us-east-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "us-east-1",
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.us-east-1.amazonaws.com",
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-east-1-fips",
|
|
}: endpoints.Endpoint{
|
|
Hostname: "sts-fips.us-east-1.amazonaws.com",
|
|
CredentialScope: endpoints.CredentialScope{
|
|
Region: "us-east-1",
|
|
},
|
|
Deprecated: aws.TrueTernary,
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-east-2",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "us-east-2",
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.us-east-2.amazonaws.com",
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-east-2-fips",
|
|
}: endpoints.Endpoint{
|
|
Hostname: "sts-fips.us-east-2.amazonaws.com",
|
|
CredentialScope: endpoints.CredentialScope{
|
|
Region: "us-east-2",
|
|
},
|
|
Deprecated: aws.TrueTernary,
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-west-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "us-west-1",
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.us-west-1.amazonaws.com",
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-west-1-fips",
|
|
}: endpoints.Endpoint{
|
|
Hostname: "sts-fips.us-west-1.amazonaws.com",
|
|
CredentialScope: endpoints.CredentialScope{
|
|
Region: "us-west-1",
|
|
},
|
|
Deprecated: aws.TrueTernary,
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-west-2",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "us-west-2",
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.us-west-2.amazonaws.com",
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-west-2-fips",
|
|
}: endpoints.Endpoint{
|
|
Hostname: "sts-fips.us-west-2.amazonaws.com",
|
|
CredentialScope: endpoints.CredentialScope{
|
|
Region: "us-west-2",
|
|
},
|
|
Deprecated: aws.TrueTernary,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
ID: "aws-cn",
|
|
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
|
{
|
|
Variant: endpoints.DualStackVariant,
|
|
}: {
|
|
Hostname: "sts.{region}.api.amazonwebservices.com.cn",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.{region}.amazonaws.com.cn",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
|
}: {
|
|
Hostname: "sts-fips.{region}.api.amazonwebservices.com.cn",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: 0,
|
|
}: {
|
|
Hostname: "sts.{region}.amazonaws.com.cn",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
},
|
|
RegionRegex: partitionRegexp.AwsCn,
|
|
IsRegionalized: true,
|
|
Endpoints: endpoints.Endpoints{
|
|
endpoints.EndpointKey{
|
|
Region: "cn-north-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "cn-northwest-1",
|
|
}: endpoints.Endpoint{},
|
|
},
|
|
},
|
|
{
|
|
ID: "aws-iso",
|
|
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
|
{
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.{region}.c2s.ic.gov",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: 0,
|
|
}: {
|
|
Hostname: "sts.{region}.c2s.ic.gov",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
},
|
|
RegionRegex: partitionRegexp.AwsIso,
|
|
IsRegionalized: true,
|
|
Endpoints: endpoints.Endpoints{
|
|
endpoints.EndpointKey{
|
|
Region: "us-iso-east-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "us-iso-west-1",
|
|
}: endpoints.Endpoint{},
|
|
},
|
|
},
|
|
{
|
|
ID: "aws-iso-b",
|
|
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
|
{
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.{region}.sc2s.sgov.gov",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: 0,
|
|
}: {
|
|
Hostname: "sts.{region}.sc2s.sgov.gov",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
},
|
|
RegionRegex: partitionRegexp.AwsIsoB,
|
|
IsRegionalized: true,
|
|
Endpoints: endpoints.Endpoints{
|
|
endpoints.EndpointKey{
|
|
Region: "us-isob-east-1",
|
|
}: endpoints.Endpoint{},
|
|
},
|
|
},
|
|
{
|
|
ID: "aws-iso-e",
|
|
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
|
{
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.{region}.cloud.adc-e.uk",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: 0,
|
|
}: {
|
|
Hostname: "sts.{region}.cloud.adc-e.uk",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
},
|
|
RegionRegex: partitionRegexp.AwsIsoE,
|
|
IsRegionalized: true,
|
|
},
|
|
{
|
|
ID: "aws-iso-f",
|
|
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
|
{
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts-fips.{region}.csp.hci.ic.gov",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: 0,
|
|
}: {
|
|
Hostname: "sts.{region}.csp.hci.ic.gov",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
},
|
|
RegionRegex: partitionRegexp.AwsIsoF,
|
|
IsRegionalized: true,
|
|
},
|
|
{
|
|
ID: "aws-us-gov",
|
|
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
|
{
|
|
Variant: endpoints.DualStackVariant,
|
|
}: {
|
|
Hostname: "sts.{region}.api.aws",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts.{region}.amazonaws.com",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
|
}: {
|
|
Hostname: "sts-fips.{region}.api.aws",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
{
|
|
Variant: 0,
|
|
}: {
|
|
Hostname: "sts.{region}.amazonaws.com",
|
|
Protocols: []string{"https"},
|
|
SignatureVersions: []string{"v4"},
|
|
},
|
|
},
|
|
RegionRegex: partitionRegexp.AwsUsGov,
|
|
IsRegionalized: true,
|
|
Endpoints: endpoints.Endpoints{
|
|
endpoints.EndpointKey{
|
|
Region: "us-gov-east-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "us-gov-east-1",
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts.us-gov-east-1.amazonaws.com",
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-gov-east-1-fips",
|
|
}: endpoints.Endpoint{
|
|
Hostname: "sts.us-gov-east-1.amazonaws.com",
|
|
CredentialScope: endpoints.CredentialScope{
|
|
Region: "us-gov-east-1",
|
|
},
|
|
Deprecated: aws.TrueTernary,
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-gov-west-1",
|
|
}: endpoints.Endpoint{},
|
|
endpoints.EndpointKey{
|
|
Region: "us-gov-west-1",
|
|
Variant: endpoints.FIPSVariant,
|
|
}: {
|
|
Hostname: "sts.us-gov-west-1.amazonaws.com",
|
|
},
|
|
endpoints.EndpointKey{
|
|
Region: "us-gov-west-1-fips",
|
|
}: endpoints.Endpoint{
|
|
Hostname: "sts.us-gov-west-1.amazonaws.com",
|
|
CredentialScope: endpoints.CredentialScope{
|
|
Region: "us-gov-west-1",
|
|
},
|
|
Deprecated: aws.TrueTernary,
|
|
},
|
|
},
|
|
},
|
|
}
|