mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
upgrade to aws-sdk-go v1.8.11 (#8091)
* upgrade to aws-sdk-go v1.8.11 * fix test
This commit is contained in:
parent
09cec3118f
commit
d2bf2e86ed
@ -16,7 +16,8 @@ func TestECSCredProvider(t *testing.T) {
|
||||
defer os.Clearenv()
|
||||
os.Setenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI", "/abc/123")
|
||||
|
||||
provider := remoteCredProvider(&session.Session{})
|
||||
sess, _ := session.NewSession()
|
||||
provider := remoteCredProvider(sess)
|
||||
|
||||
So(provider, ShouldNotBeNil)
|
||||
|
||||
@ -30,7 +31,8 @@ func TestECSCredProvider(t *testing.T) {
|
||||
|
||||
func TestDefaultEC2RoleProvider(t *testing.T) {
|
||||
Convey("Running outside an ECS container task", t, func() {
|
||||
provider := remoteCredProvider(&session.Session{})
|
||||
sess, _ := session.NewSession()
|
||||
provider := remoteCredProvider(sess)
|
||||
|
||||
So(provider, ShouldNotBeNil)
|
||||
|
||||
|
760
vendor/github.com/aws/aws-sdk-go/CHANGELOG.md
generated
vendored
760
vendor/github.com/aws/aws-sdk-go/CHANGELOG.md
generated
vendored
@ -1,23 +1,745 @@
|
||||
Release v1.8.11 (2017-04-07)
|
||||
===
|
||||
|
||||
### Service Client Updates
|
||||
* `service/redshift`: Updates service API, documentation, and paginators
|
||||
* This update adds the GetClusterCredentials API which is used to get temporary login credentials to the cluster. AccountWithRestoreAccess now has a new member AccountAlias, this is the identifier of the AWS support account authorized to restore the specified snapshot. This is added to support the feature where the customer can share their snapshot with the Amazon Redshift Support Account without having to manually specify the AWS Redshift Service account ID on the AWS Console/API.
|
||||
|
||||
Release v1.8.10 (2017-04-06)
|
||||
===
|
||||
|
||||
### Service Client Updates
|
||||
* `service/elbv2`: Updates service documentation
|
||||
|
||||
Release v1.8.9 (2017-04-05)
|
||||
===
|
||||
|
||||
### Service Client Updates
|
||||
* `service/elasticache`: Updates service API, documentation, paginators, and examples
|
||||
* ElastiCache added support for testing the Elasticache Multi-AZ feature with Automatic Failover.
|
||||
|
||||
Release v1.8.8 (2017-04-04)
|
||||
===
|
||||
|
||||
### Service Client Updates
|
||||
* `service/cloudwatch`: Updates service API, documentation, and paginators
|
||||
* Amazon Web Services announced the immediate availability of two additional alarm configuration rules for Amazon CloudWatch Alarms. The first rule is for configuring missing data treatment. Customers have the options to treat missing data as alarm threshold breached, alarm threshold not breached, maintain alarm state and the current default treatment. The second rule is for alarms based on percentiles metrics that can trigger unnecassarily if the percentile is calculated from a small number of samples. The new rule can treat percentiles with low sample counts as same as missing data. If the first rule is enabled, the same treatment will be applied when an alarm encounters a percentile with low sample counts.
|
||||
|
||||
Release v1.8.7 (2017-04-03)
|
||||
===
|
||||
|
||||
### Service Client Updates
|
||||
* `service/lexruntimeservice`: Updates service API and documentation
|
||||
* Adds support to PostContent for speech input
|
||||
|
||||
### SDK Enhancements
|
||||
* `aws/request`: Improve handler copy, push back, push front performance (#1171)
|
||||
* Minor optimization to the handler list's handling of copying and pushing request handlers to the handler list.
|
||||
* Update codegen header to use Go std wording (#1172)
|
||||
* Go recently accepted the proposal for standard generated file header wording in, https://golang.org/s/generatedcode.
|
||||
|
||||
### SDK Bugs
|
||||
* `service/dynamodb`: Fix DynamoDB using custom retryer (#1170)
|
||||
* Fixes (#1139) the DynamoDB service client clobbering any custom retryer that was passed into the service client or Session's config.
|
||||
Release v1.8.6 (2017-04-01)
|
||||
===
|
||||
|
||||
### Service Client Updates
|
||||
* `service/clouddirectory`: Updates service API and documentation
|
||||
* ListObjectAttributes now supports filtering by facet.
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
|
||||
Release v1.8.5 (2017-03-30)
|
||||
===
|
||||
|
||||
### Service Client Updates
|
||||
* `service/cloudformation`: Updates service waiters and paginators
|
||||
* Adding paginators for ListExports and ListImports
|
||||
* `service/cloudfront`: Adds new service
|
||||
* Amazon CloudFront now supports user configurable HTTP Read and Keep-Alive Idle Timeouts for your Custom Origin Servers
|
||||
* `service/configservice`: Updates service documentation
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/resourcegroupstaggingapi`: Adds new service
|
||||
* `service/storagegateway`: Updates service API and documentation
|
||||
* File gateway mode in AWS Storage gateway provides access to objects in S3 as files on a Network File System (NFS) mount point. Once a file share is created, any changes made externally to the S3 bucket will not be reflected by the gateway. Using the cache refresh feature in this update, the customer can trigger an on-demand scan of the keys in their S3 bucket and refresh the file namespace cached on the gateway. It takes as an input the fileShare ARN and refreshes the cache for only that file share. Additionally there is new functionality on file gateway that allows you configure what squash options they would like on their file share, this allows a customer to configure their gateway to not squash root permissions. This can be done by setting options in NfsOptions for CreateNfsFileShare and UpdateNfsFileShare APIs.
|
||||
|
||||
Release v1.8.4 (2017-03-28)
|
||||
===
|
||||
|
||||
### Service Client Updates
|
||||
* `service/batch`: Updates service API, documentation, and paginators
|
||||
* Customers can now provide a retryStrategy as part of the RegisterJobDefinition and SubmitJob API calls. The retryStrategy object has a number value for attempts. This is the number of non successful executions before a job is considered FAILED. In addition, the JobDetail object now has an attempts field and shows all execution attempts.
|
||||
* `service/ec2`: Updates service API and documentation
|
||||
* Customers can now tag their Amazon EC2 Instances and Amazon EBS Volumes at
|
||||
the time of their creation. You can do this from the EC2 Instance launch
|
||||
wizard or through the RunInstances or CreateVolume APIs. By tagging
|
||||
resources at the time of creation, you can eliminate the need to run custom
|
||||
tagging scripts after resource creation. In addition, you can now set
|
||||
resource-level permissions on the CreateVolume, CreateTags, DeleteTags, and
|
||||
the RunInstances APIs. This allows you to implement stronger security
|
||||
policies by giving you more granular control over which users and groups
|
||||
have access to these APIs. You can also enforce the use of tagging and
|
||||
control what tag keys and values are set on your resources. When you combine
|
||||
tag usage and resource-level IAM policies together, you can ensure your
|
||||
instances and volumes are properly secured upon creation and achieve more
|
||||
accurate cost allocation reporting. These new features are provided at no
|
||||
additional cost.
|
||||
|
||||
### SDK Enhancements
|
||||
* `aws/request`: Add retry support for RequestTimeoutException (#1158)
|
||||
* Adds support for retrying RequestTimeoutException error code that is returned by some services.
|
||||
|
||||
### SDK Bugs
|
||||
* `private/model/api`: Fix Waiter and Paginators panic on nil param inputs (#1157)
|
||||
* Corrects the code generation for Paginators and waiters that caused a panic if nil input parameters were used with the operations.
|
||||
Release v1.8.3 (2017-03-27)
|
||||
===
|
||||
|
||||
## Service Client Updates
|
||||
* `service/ssm`: Updates service API, documentation, and paginators
|
||||
* Updated validation rules for SendCommand and RegisterTaskWithMaintenanceWindow APIs.
|
||||
Release v1.8.2 (2017-03-24)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/applicationautoscaling`: Updates service API, documentation, and paginators
|
||||
* Application AutoScaling is launching support for a new target resource (AppStream 2.0 Fleets) as a scalable target.
|
||||
* `service/cloudtrail`: Updates service API and documentation
|
||||
* Doc-only Update for CloudTrail: Add required parameters for GetEventSelectors and PutEventSelectors
|
||||
|
||||
Release v1.8.1 (2017-03-23)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/applicationdiscoveryservice`: Updates service API, documentation, and paginators
|
||||
* Adds export configuration options to the AWS Discovery Service API.
|
||||
* `service/elbv2`: Updates waiters
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/lambda`: Updates service API and paginators
|
||||
* Adds support for new runtime Node.js v6.10 for AWS Lambda service
|
||||
|
||||
Release v1.8.0 (2017-03-22)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/codebuild`: Updates service documentation
|
||||
* `service/directconnect`: Updates service API
|
||||
* Deprecated DescribeConnectionLoa, DescribeInterconnectLoa, AllocateConnectionOnInterconnect and DescribeConnectionsOnInterconnect operations in favor of DescribeLoa, DescribeLoa, AllocateHostedConnection and DescribeHostedConnections respectively.
|
||||
* `service/marketplacecommerceanalytics`: Updates service API, documentation, and paginators
|
||||
* This update adds a new data set, us_sales_and_use_tax_records, which enables AWS Marketplace sellers to programmatically access to their U.S. Sales and Use Tax report data.
|
||||
* `service/pinpoint`: Updates service API and documentation
|
||||
* Amazon Pinpoint User Segmentation
|
||||
* Added ability to segment endpoints by user attributes in addition to endpoint attributes. Amazon Pinpoint Event Stream Preview
|
||||
* Added functionality to publish raw app analytics and campaign events data as events streams to Kinesis and Kinesis Firehose
|
||||
* The feature provides developers with increased flexibility of exporting raw events to S3, Redshift, Elasticsearch using a Kinesis Firehose stream or enable real time event processing use cases using a Kinesis stream
|
||||
* `service/rekognition`: Updates service documentation.
|
||||
|
||||
SDK Features
|
||||
---
|
||||
* `aws/request`: Add support for context.Context to SDK API operation requests (#1132)
|
||||
* Adds support for context.Context to the SDK by adding `WithContext` methods for each API operation, Paginators and Waiters. e.g `PutObjectWithContext`. This change also adds the ability to provide request functional options to the method calls instead of requiring you to use the `Request` API operation method (e.g `PutObjectRequest`).
|
||||
* Adds a `Complete` Request handler list that will be called ever time a request is completed. This includes both success and failure. Complete will only be called once per API operation request.
|
||||
* `private/waiter` package moved from the private group to `aws/request/waiter` and made publicly available.
|
||||
* Adds Context support to all API operations, Waiters(WaitUntil) and Paginators(Pages) methods.
|
||||
* Adds Context support for s3manager and s3crypto clients.
|
||||
|
||||
SDK Enhancements
|
||||
---
|
||||
* `aws/signer/v4`: Adds support for unsigned payload signer config (#1130)
|
||||
* Adds configuration option to the v4.Signer to specify the request's body should not be signed. This will only correclty function on services that support unsigned payload. e.g. S3, Glacier.
|
||||
|
||||
SDK Bug Fixes
|
||||
---
|
||||
* `service/s3`: Fix S3 HostID to be available in S3 request error message (#1131)
|
||||
* Adds a new type s3.RequestFailure which exposes the S3 HostID value from a S3 API operation response. This is helpful when you have an error with S3, and need to contact support. Both RequestID and HostID are needed.
|
||||
* `private/model/api`: Do not return a link if uid is empty (#1133)
|
||||
* Fixes SDK's doc generation to not generate API reference doc links if the SDK us unable to create a valid link.
|
||||
* `aws/request`: Optimization to handler list copy to prevent multiple alloc calls. (#1134)
|
||||
Release v1.7.9 (2017-03-13)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/devicefarm`: Updates service API, documentation, paginators, and examples
|
||||
* Network shaping allows users to simulate network connections and conditions while testing their Android, iOS, and web apps with AWS Device Farm.
|
||||
* `service/cloudwatchevents`: Updates service API, documentation, and examples
|
||||
|
||||
SDK Enhancement
|
||||
===
|
||||
* `aws/session`: Add support for side loaded CA bundles (#1117)
|
||||
* Adds supports for side loading Certificate Authority bundle files to the SDK using AWS_CA_BUNDLE environment variable or CustomCABundle session option.
|
||||
* `service/s3/s3crypto`: Add support for AES/CBC/PKCS5Padding (#1124)
|
||||
|
||||
SDK Bug
|
||||
===
|
||||
* `service/rds`: Fixing issue when not providing `SourceRegion` on cross
|
||||
region operations (#1127)
|
||||
* `service/rds`: Enables cross region for `CopyDBClusterSnapshot` and
|
||||
`CreateDBCluster` (#1128)
|
||||
|
||||
Release v1.7.8 (2017-03-10)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/codedeploy`: Updates service paginators
|
||||
* Add paginators for Codedeploy
|
||||
* `service/emr`: Updates service API, documentation, and paginators
|
||||
* This release includes support for instance fleets in Amazon EMR.
|
||||
|
||||
Release v1.7.7 (2017-03-09)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/apigateway`: Updates service API, documentation, and paginators
|
||||
* API Gateway has added support for ACM certificates on custom domain names. Both Amazon-issued certificates and uploaded third-part certificates are supported.
|
||||
* `service/clouddirectory`: Updates service API, documentation, and paginators
|
||||
* Introduces a new Cloud Directory API that enables you to retrieve all available parent paths for any type of object (a node, leaf node, policy node, and index node) in a hierarchy.
|
||||
|
||||
Release v1.7.6 (2017-03-09)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/organizations`: Updates service documentation and examples
|
||||
* Doc-only Update for Organizations: Add SDK Code Snippets
|
||||
* `service/workdocs`: Adds new service
|
||||
* The Administrative SDKs for Amazon WorkDocs provides full administrator level access to WorkDocs site resources, allowing developers to integrate their applications to manage WorkDocs users, content and permissions programmatically
|
||||
|
||||
Release v1.7.5 (2017-03-08)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/rds`: Updates service API and documentation
|
||||
* Add support to using encrypted clusters as cross-region replication masters. Update CopyDBClusterSnapshot API to support encrypted cross region copy of Aurora cluster snapshots.
|
||||
|
||||
Release v1.7.4 (2017-03-06)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/budgets`: Updates service API and paginators
|
||||
* When creating or editing a budget via the AWS Budgets API you can define notifications that are sent to subscribers when the actual or forecasted value for cost or usage exceeds the notificationThreshold associated with the budget notification object. Starting today, the maximum allowed value for the notificationThreshold was raised from 100 to 300. This change was made to give you more flexibility when setting budget notifications.
|
||||
* `service/cloudtrail`: Updates service documentation and paginators
|
||||
* Doc-only update for AWSCloudTrail: Updated links/descriptions
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/opsworkscm`: Updates service API, documentation, and paginators
|
||||
* OpsWorks for Chef Automate has added a new field "AssociatePublicIpAddress" to the CreateServer request, "CloudFormationStackArn" to the Server model and "TERMINATED" server state.
|
||||
|
||||
|
||||
Release v1.7.3 (2017-02-28)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/mturk`: Renaming service
|
||||
* service/mechanicalturkrequesterservice was renamed to service/mturk. Be sure to change any references of the old client to the new.
|
||||
|
||||
Release v1.7.2 (2017-02-28)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/dynamodb`: Updates service API and documentation
|
||||
* Release notes: Time to Live (TTL) is a feature that allows you to define when items in a table expire and can be purged from the database, so that you don't have to track expired data and delete it manually. With TTL enabled on a DynamoDB table, you can set a timestamp for deletion on a per-item basis, allowing you to limit storage usage to only those records that are relevant.
|
||||
* `service/iam`: Updates service API, documentation, and paginators
|
||||
* This release adds support for AWS Organizations service control policies (SCPs) to SimulatePrincipalPolicy operation. If there are SCPs associated with the simulated user's account, their effect on the result is captured in the OrganizationDecisionDetail element in the EvaluationResult.
|
||||
* `service/mechanicalturkrequesterservice`: Adds new service
|
||||
* Amazon Mechanical Turk is a web service that provides an on-demand, scalable, human workforce to complete jobs that humans can do better than computers, for example, recognizing objects in photos.
|
||||
* `service/organizations`: Adds new service
|
||||
* AWS Organizations is a web service that enables you to consolidate your multiple AWS accounts into an organization and centrally manage your accounts and their resources.
|
||||
* `service/dynamodbstreams`: Updates service API, documentation, and paginators
|
||||
* `service/waf`: Updates service API, documentation, and paginators
|
||||
* Aws WAF - For GetSampledRequests action, changed max number of samples from 100 to 500.
|
||||
* `service/wafregional`: Updates service API, documentation, and paginators
|
||||
|
||||
Release v1.7.1 (2017-02-24)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/elasticsearchservice`: Updates service API, documentation, paginators, and examples
|
||||
* Added three new API calls to existing Amazon Elasticsearch service to expose Amazon Elasticsearch imposed limits to customers.
|
||||
|
||||
Release v1.7.0 (2017-02-23)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/ec2`: Updates service API
|
||||
* New EC2 I3 instance type
|
||||
|
||||
SDK Bug
|
||||
---
|
||||
* `service/s3/s3manager`: Adding support for SSE (#1097)
|
||||
* Fixes SSE fields not being applied to a part during multi part upload.
|
||||
|
||||
SDK Feature
|
||||
---
|
||||
* `aws/session`: Add support for AssumeRoles with MFA (#1088)
|
||||
* Adds support for assuming IAM roles with MFA enabled. A TokenProvider func was added to stscreds.AssumeRoleProvider that will be called each time the role's credentials need to be refreshed. A basic token provider that sources the MFA token from stdin as stscreds.StdinTokenProvider.
|
||||
* `aws/session`: Update SDK examples and docs to use session.Must (#1099)
|
||||
* Updates the SDK's example and docs to use session.Must where possible to highlight its usage as apposed to session error checking that is most cases errors will be terminal to the application anyways.
|
||||
Release v1.6.27 (2017-02-22)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/clouddirectory`: Updates service documentation
|
||||
* ListObjectAttributes documentation updated based on forum feedback
|
||||
* `service/elasticbeanstalk`: Updates service API, documentation, and paginators
|
||||
* Elastic Beanstalk adds support for creating and managing custom platform.
|
||||
* `service/gamelift`: Updates service API, documentation, and paginators
|
||||
* Allow developers to configure global queues for creating GameSessions. Allow PlayerData on PlayerSessions to store player-specific data.
|
||||
* `service/route53`: Updates service API, documentation, and examples
|
||||
* Added support for operations CreateVPCAssociationAuthorization and DeleteVPCAssociationAuthorization to throw a ConcurrentModification error when a conflicting modification occurs in parallel to the authorizations in place for a given hosted zone.
|
||||
|
||||
Release v1.6.26 (2017-02-21)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/ec2`: Updates service API and documentation
|
||||
* Added the billingProduct parameter to the RegisterImage API.
|
||||
|
||||
Release v1.6.25 (2017-02-17)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/directconnect`: Updates service API, documentation, and paginators
|
||||
* This update will introduce the ability for Direct Connect customers to take advantage of Link Aggregation (LAG). This allows you to bundle many individual physical interfaces into a single logical interface, referred to as a LAG. This makes administration much simpler as the majority of configuration is done on the LAG while you are free to add or remove physical interfaces from the bundle as bandwidth demand increases or decreases. A concrete example of the simplification added by LAG is that customers need only a single BGP session as opposed to one session per physical connection.
|
||||
|
||||
Release v1.6.24 (2017-02-16)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/cognitoidentity`: Updates service API, documentation, and paginators
|
||||
* Allow createIdentityPool and updateIdentityPool API to set server side token check value on identity pool
|
||||
* `service/configservice`: Updates service API and documentation
|
||||
* AWS Config now supports a new test mode for the PutEvaluations API. Set the TestMode parameter to true in your custom rule to verify whether your AWS Lambda function will deliver evaluation results to AWS Config. No updates occur to your existing evaluations, and evaluation results are not sent to AWS Config.
|
||||
|
||||
Release v1.6.23 (2017-02-15)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/kms`: Updates service API, documentation, paginators, and examples
|
||||
* his release of AWS Key Management Service introduces the ability to tag keys. Tagging keys can help you organize your keys and track your KMS costs in the cost allocation report. This release also increases the maximum length of a key ID to accommodate ARNs that include a long key alias.
|
||||
|
||||
Release v1.6.22 (2017-02-14)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/ec2`: Updates service API, documentation, and paginators
|
||||
* Adds support for the new Modify Volumes apis.
|
||||
|
||||
Release v1.6.21 (2017-02-11)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/storagegateway`: Updates service API, documentation, and paginators
|
||||
* File gateway mode in AWS Storage gateway provides access to objects in S3 as files on a Network File System (NFS) mount point. This is done by creating Nfs file shares using existing APIs CreateNfsFileShare. Using the feature in this update, the customer can restrict the clients that have read/write access to the gateway by specifying the list of clients as a list of IP addresses or CIDR blocks. This list can be specified using the API CreateNfsFileShare while creating new file shares, or UpdateNfsFileShare while update existing file shares. To find out the list of clients that have access, the existing API DescribeNfsFileShare will now output the list of clients that have access.
|
||||
|
||||
Release v1.6.20 (2017-02-09)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/ec2`: Updates service API and documentation
|
||||
* This feature allows customers to associate an IAM profile to running instances that do not have any.
|
||||
* `service/rekognition`: Updates service API and documentation
|
||||
* DetectFaces and IndexFaces operations now return an estimate of the age of the face as an age range.
|
||||
|
||||
SDK Features
|
||||
---
|
||||
* `aws/endpoints`: Add option to resolve unknown endpoints (#1074)
|
||||
Release v1.6.19 (2017-02-08)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/glacier`: Updates service examples
|
||||
* Doc Update
|
||||
* `service/lexruntimeservice`: Adds new service
|
||||
* Preview release
|
||||
|
||||
SDK Bug Fixes
|
||||
---
|
||||
* `private/protocol/json`: Fixes json to throw an error if a float number is (+/-)Inf and NaN (#1068)
|
||||
* `private/model/api`: Fix documentation error listing (#1067)
|
||||
|
||||
SDK Features
|
||||
---
|
||||
* `private/model`: Add service response error code generation (#1061)
|
||||
|
||||
Release v1.6.18 (2017-01-27)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/clouddirectory`: Adds new service
|
||||
* Amazon Cloud Directory is a highly scalable, high performance, multi-tenant directory service in the cloud. Its web-based directories make it easy for you to organize and manage application resources such as users, groups, locations, devices, policies, and the rich relationships between them.
|
||||
* `service/codedeploy`: Updates service API, documentation, and paginators
|
||||
* This release of AWS CodeDeploy introduces support for blue/green deployments. In a blue/green deployment, the current set of instances in a deployment group is replaced by new instances that have the latest application revision installed on them. After traffic is rerouted behind a load balancer to the replacement instances, the original instances can be terminated automatically or kept running for other uses.
|
||||
* `service/ec2`: Updates service API and documentation
|
||||
* Adds instance health check functionality to replace unhealthy EC2 Spot fleet instances with fresh ones.
|
||||
* `service/rds`: Updates service API and documentation
|
||||
* Snapshot Engine Version Upgrade
|
||||
|
||||
Release v1.6.17 (2017-01-25)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/elbv2`: Updates service API, documentation, and paginators
|
||||
* Application Load Balancers now support native Internet Protocol version 6 (IPv6) in an Amazon Virtual Private Cloud (VPC). With this ability, clients can now connect to the Application Load Balancer in a dual-stack mode via either IPv4 or IPv6.
|
||||
* `service/rds`: Updates service API and documentation
|
||||
* Cross Region Read Replica Copying (CreateDBInstanceReadReplica)
|
||||
|
||||
Release v1.6.16 (2017-01-24)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/codebuild`: Updates service documentation and paginators
|
||||
* Documentation updates
|
||||
* `service/codecommit`: Updates service API, documentation, and paginators
|
||||
* AWS CodeCommit now includes the option to view the differences between a commit and its parent commit from within the console. You can view the differences inline (Unified view) or side by side (Split view). To view information about the differences between a commit and something other than its parent, you can use the AWS CLI and the get-differences and get-blob commands, or you can use the GetDifferences and GetBlob APIs.
|
||||
* `service/ecs`: Updates service API and documentation
|
||||
* Amazon ECS now supports a state for container instances that can be used to drain a container instance in preparation for maintenance or cluster scale down.
|
||||
|
||||
Release v1.6.15 (2017-01-20)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/acm`: Updates service API, documentation, and paginators
|
||||
* Update for AWS Certificate Manager: Updated response elements for DescribeCertificate API in support of managed renewal
|
||||
* `service/health`: Updates service documentation
|
||||
|
||||
Release v1.6.14 (2017-01-19)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/ec2`: Updates service API, documentation, and paginators
|
||||
* Amazon EC2 Spot instances now support dedicated tenancy, providing the ability to run Spot instances single-tenant manner on physically isolated hardware within a VPC to satisfy security, privacy, or other compliance requirements. Dedicated Spot instances can be requested using RequestSpotInstances and RequestSpotFleet.
|
||||
|
||||
Release v1.6.13 (2017-01-18)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/rds`: Updates service API, documentation, and paginators
|
||||
|
||||
Release v1.6.12 (2017-01-17)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/dynamodb`: Updates service API, documentation, and paginators
|
||||
* Tagging Support for Amazon DynamoDB Tables and Indexes
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/glacier`: Updates service API, paginators, and examples
|
||||
* Doc-only Update for Glacier: Added code snippets
|
||||
* `service/polly`: Updates service documentation and examples
|
||||
* Doc-only update for Amazon Polly -- added snippets
|
||||
* `service/rekognition`: Updates service documentation and paginators
|
||||
* Added code samples to Rekognition reference topics.
|
||||
* `service/route53`: Updates service API and paginators
|
||||
* Add ca-central-1 and eu-west-2 enum values to CloudWatchRegion enum
|
||||
|
||||
Release v1.6.11 (2017-01-16)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/configservice`: Updates service API, documentation, and paginators
|
||||
* `service/costandusagereportservice`: Adds new service
|
||||
* The AWS Cost and Usage Report Service API allows you to enable and disable the Cost & Usage report, as well as modify the report name, the data granularity, and the delivery preferences.
|
||||
* `service/dynamodb`: Updates service API, documentation, and examples
|
||||
* Snippets for the DynamoDB API.
|
||||
* `service/elasticache`: Updates service API, documentation, and examples
|
||||
* Adds new code examples.
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
|
||||
Release v1.6.10 (2017-01-04)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/configservice`: Updates service API and documentation
|
||||
* AWSConfig is planning to add support for OversizedConfigurationItemChangeNotification message type in putConfigRule. After this release customers can use/write rules based on OversizedConfigurationItemChangeNotification mesage type.
|
||||
* `service/efs`: Updates service API, documentation, and examples
|
||||
* Doc-only Update for EFS: Added code snippets
|
||||
* `service/iam`: Updates service documentation and examples
|
||||
* `service/lambda`: Updates service documentation and examples
|
||||
* Doc only updates for Lambda: Added code snippets
|
||||
* `service/marketplacecommerceanalytics`: Updates service API and documentation
|
||||
* Added support for data set disbursed_amount_by_instance_hours, with historical data available starting 2012-09-04. New data is published to this data set every 30 days.
|
||||
* `service/rds`: Updates service documentation
|
||||
* Updated documentation for CopyDBSnapshot.
|
||||
* `service/rekognition`: Updates service documentation and examples
|
||||
* Doc-only Update for Rekognition: Added code snippets
|
||||
* `service/snowball`: Updates service examples
|
||||
* `service/dynamodbstreams`: Updates service API and examples
|
||||
* Doc-only Update for DynamoDB Streams: Added code snippets
|
||||
|
||||
SDK Feature
|
||||
---
|
||||
* `private/model/api`: Increasing the readability of code generated files. (#1024)
|
||||
Release v1.6.9 (2016-12-30)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/codedeploy`: Updates service API and documentation
|
||||
* CodeDeploy will support Iam Session Arns in addition to Iam User Arns for on premise host authentication.
|
||||
* `service/ecs`: Updates service API and documentation
|
||||
* Amazon EC2 Container Service (ECS) now supports the ability to customize the placement of tasks on container instances.
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
|
||||
Release v1.6.8 (2016-12-22)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/apigateway`: Updates service API and documentation
|
||||
* Amazon API Gateway is adding support for generating SDKs in more languages. This update introduces two new operations used to dynamically discover these SDK types and what configuration each type accepts.
|
||||
* `service/directoryservice`: Updates service documentation
|
||||
* Added code snippets for the DS SDKs
|
||||
* `service/elasticbeanstalk`: Updates service API and documentation
|
||||
* `service/iam`: Updates service API and documentation
|
||||
* Adds service-specific credentials to IAM service to make it easier to onboard CodeCommit customers. These are username/password credentials that work with a single service.
|
||||
* `service/kms`: Updates service API, documentation, and examples
|
||||
* Update docs and add SDK examples
|
||||
|
||||
Release v1.6.7 (2016-12-22)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/ecr`: Updates service API and documentation
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/rds`: Updates service API and documentation
|
||||
* Cross Region Encrypted Snapshot Copying (CopyDBSnapshot)
|
||||
|
||||
Release v1.6.6 (2016-12-20)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/firehose`: Updates service API, documentation, and examples
|
||||
* Processing feature enables users to process and modify records before Amazon Firehose delivers them to destinations.
|
||||
* `service/route53`: Updates service API and documentation
|
||||
* Enum updates for eu-west-2 and ca-central-1
|
||||
* `service/storagegateway`: Updates service API, documentation, and examples
|
||||
* File gateway is a new mode in the AWS Storage Gateway that support a file interface into S3, alongside the current block-based volume and VTL storage. File gateway combines a service and virtual software appliance, enabling you to store and retrieve objects in Amazon S3 using industry standard file protocols such as NFS. The software appliance, or gateway, is deployed into your on-premises environment as a virtual machine (VM) running on VMware ESXi. The gateway provides access to objects in S3 as files on a Network File System (NFS) mount point.
|
||||
|
||||
Release v1.6.5 (2016-12-19)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/cloudformation`: Updates service documentation
|
||||
* Minor doc update for CloudFormation.
|
||||
* `service/cloudtrail`: Updates service paginators
|
||||
* `service/cognitoidentity`: Updates service API and documentation
|
||||
* We are adding Groups to Cognito user pools. Developers can perform CRUD operations on groups, add and remove users from groups, list users in groups, etc. We are adding fine-grained role-based access control for Cognito identity pools. Developers can configure an identity pool to get the IAM role from an authenticated user's token, or they can configure rules that will map a user to a different role
|
||||
* `service/applicationdiscoveryservice`: Updates service API and documentation
|
||||
* Adds new APIs to group discovered servers into Applications with get summary and neighbors. Includes additional filters for ListConfigurations and DescribeAgents API.
|
||||
* `service/inspector`: Updates service API, documentation, and examples
|
||||
* Doc-only Update for Inspector: Adding SDK code snippets for Inspector
|
||||
* `service/sqs`: Updates service documentation
|
||||
|
||||
SDK Bug Fixes
|
||||
---
|
||||
* `aws/request`: Add PriorRequestNotComplete to throttle retry codes (#1011)
|
||||
* Fixes: Not retrying when PriorRequestNotComplete #1009
|
||||
|
||||
SDK Feature
|
||||
---
|
||||
* `private/model/api`: Adds crosslinking to service documentation (#1010)
|
||||
|
||||
Release v1.6.4 (2016-12-15)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/cognitoidentityprovider`: Updates service API and documentation
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/ssm`: Updates service API and documentation
|
||||
* This will provide customers with access to the Patch Baseline and Patch Compliance APIs.
|
||||
|
||||
SDK Bug Fixes
|
||||
---
|
||||
* `service/route53`: Fix URL path cleaning for Route53 API requests (#1006)
|
||||
* Fixes: SerializationError when using Route53 ChangeResourceRecordSets #1005
|
||||
* `aws/request`: Add PriorRequestNotComplete to throttle retry codes (#1002)
|
||||
* Fixes: Not retrying when PriorRequestNotComplete #1001
|
||||
|
||||
Release v1.6.3 (2016-12-14)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/batch`: Adds new service
|
||||
* AWS Batch is a batch computing service that lets customers define queues and compute environments and then submit work as batch jobs.
|
||||
* `service/databasemigrationservice`: Updates service API and documentation
|
||||
* Adds support for SSL enabled Oracle endpoints and task modification.
|
||||
* `service/elasticbeanstalk`: Updates service documentation
|
||||
* `aws/endpoints`: Updated Regions and Endpoints metadata.
|
||||
* `service/cloudwatchlogs`: Updates service API and documentation
|
||||
* Add support for associating LogGroups with AWSTagris tags
|
||||
* `service/marketplacecommerceanalytics`: Updates service API and documentation
|
||||
* Add new enum to DataSetType: sales_compensation_billed_revenue
|
||||
* `service/rds`: Updates service documentation
|
||||
* Doc-only Update for RDS: New versions available in CreateDBInstance
|
||||
* `service/sts`: Updates service documentation
|
||||
* Adding Code Snippet Examples for SDKs for STS
|
||||
|
||||
SDK Bug Fixes
|
||||
---
|
||||
* `aws/request`: Fix retrying timeout requests (#981)
|
||||
* Fixes: Requests Retrying is broken if the error was caused due to a client timeout #947
|
||||
* `aws/request`: Fix for Go 1.8 request incorrectly sent with body (#991)
|
||||
* Fixes: service/route53: ListHostedZones hangs and then fails with go1.8 #984
|
||||
* private/protocol/rest: Use RawPath instead of Opaque (#993)
|
||||
* Fixes: HTTP2 request failing with REST protocol services, e.g AWS X-Ray
|
||||
* private/model/api: Generate REST-JSON JSONVersion correctly (#998)
|
||||
* Fixes: REST-JSON protocol service code missing JSONVersion metadata.
|
||||
|
||||
Release v1.6.2 (2016-12-08)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/cloudfront`: Add lambda function associations to cache behaviors
|
||||
* `service/codepipeline`: This is a doc-only update request to incorporate some recent minor revisions to the doc content.
|
||||
* `service/rds`: Updates service API and documentation
|
||||
* `service/wafregional`: With this new feature, customers can use AWS WAF directly on Application Load Balancers in a VPC within available regions to protect their websites and web services from malicious attacks such as SQL injection, Cross Site Scripting, bad bots, etc.
|
||||
|
||||
Release v1.6.1 (2016-12-07)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/config`: Updates service API
|
||||
* `service/s3`: Updates service API
|
||||
* `service/sqs`: Updates service API and documentation
|
||||
|
||||
Release v1.6.0 (2016-12-06)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/config`: Updates service API and documentation
|
||||
* `service/ec2`: Updates service API
|
||||
* `service/sts`: Updates service API, documentation, and examples
|
||||
|
||||
SDK Bug Fixes
|
||||
---
|
||||
* private/protocol/xml/xmlutil: Fix SDK XML unmarshaler #975
|
||||
* Fixes GetBucketACL Grantee required type always nil. #916
|
||||
|
||||
SDK Feature
|
||||
---
|
||||
* aws/endpoints: Add endpoint metadata to SDK #961
|
||||
* Adds Region and Endpoint metadata to the SDK. This allows you to enumerate regions and endpoint metadata based on a defined model embedded in the SDK.
|
||||
|
||||
Release v1.5.13 (2016-12-01)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/apigateway`: Updates service API and documentation
|
||||
* `service/appstream`: Adds new service
|
||||
* `service/codebuild`: Adds new service
|
||||
* `service/directconnect`: Updates service API and documentation
|
||||
* `service/ec2`: Adds new service
|
||||
* `service/elasticbeanstalk`: Updates service API and documentation
|
||||
* `service/health`: Adds new service
|
||||
* `service/lambda`: Updates service API and documentation
|
||||
* `service/opsworkscm`: Adds new service
|
||||
* `service/pinpoint`: Adds new service
|
||||
* `service/shield`: Adds new service
|
||||
* `service/ssm`: Updates service API and documentation
|
||||
* `service/states`: Adds new service
|
||||
* `service/xray`: Adds new service
|
||||
|
||||
Release v1.5.12 (2016-11-30)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/lightsail`: Adds new service
|
||||
* `service/polly`: Adds new service
|
||||
* `service/rekognition`: Adds new service
|
||||
* `service/snowball`: Updates service API and documentation
|
||||
|
||||
Release v1.5.11 (2016-11-29)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
`service/s3`: Updates service API and documentation
|
||||
|
||||
Release v1.5.10 (2016-11-22)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/cloudformation`: Updates service API and documentation
|
||||
* `service/glacier`: Updates service API, documentation, and examples
|
||||
* `service/route53`: Updates service API and documentation
|
||||
* `service/s3`: Updates service API and documentation
|
||||
|
||||
SDK Bug Fixes
|
||||
---
|
||||
* `private/protocol/xml/xmlutil`: Fixes xml marshaler to unmarshal properly
|
||||
into tagged fields
|
||||
[#916](https://github.com/aws/aws-sdk-go/issues/916)
|
||||
|
||||
Release v1.5.9 (2016-11-22)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/cloudtrail`: Updates service API and documentation
|
||||
* `service/ecs`: Updates service API and documentation
|
||||
|
||||
Release v1.5.8 (2016-11-18)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
`service/application-autoscaling`: Updates service API and documentation
|
||||
`service/elasticmapreduce`: Updates service API and documentation
|
||||
`service/elastictranscoder`: Updates service API, documentation, and examples
|
||||
`service/gamelift`: Updates service API and documentation
|
||||
`service/lambda`: Updates service API and documentation
|
||||
* `service/application-autoscaling`: Updates service API and documentation
|
||||
* `service/elasticmapreduce`: Updates service API and documentation
|
||||
* `service/elastictranscoder`: Updates service API, documentation, and examples
|
||||
* `service/gamelift`: Updates service API and documentation
|
||||
* `service/lambda`: Updates service API and documentation
|
||||
|
||||
Release v1.5.7 (2016-11-18)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
`service/apigateway`: Updates service API and documentation
|
||||
`service/meteringmarketplace`: Updates service API and documentation
|
||||
`service/monitoring`: Updates service API and documentation
|
||||
`service/sqs`: Updates service API, documentation, and examples
|
||||
* `service/apigateway`: Updates service API and documentation
|
||||
* `service/meteringmarketplace`: Updates service API and documentation
|
||||
* `service/monitoring`: Updates service API and documentation
|
||||
* `service/sqs`: Updates service API, documentation, and examples
|
||||
|
||||
Release v1.5.6 (2016-11-16)
|
||||
===
|
||||
@ -32,46 +754,46 @@ Release v1.5.5 (2016-11-15)
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
`service/ds`: Updates service API and documentation
|
||||
`service/elasticache`: Updates service API and documentation
|
||||
`service/kinesis`: Updates service API and documentation
|
||||
* `service/ds`: Updates service API and documentation
|
||||
* `service/elasticache`: Updates service API and documentation
|
||||
* `service/kinesis`: Updates service API and documentation
|
||||
|
||||
Release v1.5.4 (2016-11-15)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
`service/cognito-idp`: Updates service API and documentation
|
||||
* `service/cognito-idp`: Updates service API and documentation
|
||||
|
||||
Release v1.5.3 (2016-11-11)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
`service/cloudformation`: Updates service documentation and examples
|
||||
`service/logs`: Updates service API and documentation
|
||||
* `service/cloudformation`: Updates service documentation and examples
|
||||
* `service/logs`: Updates service API and documentation
|
||||
|
||||
Release v1.5.2 (2016-11-03)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
`service/directconnect`: Updates service API and documentation
|
||||
* `service/directconnect`: Updates service API and documentation
|
||||
|
||||
Release v1.5.1 (2016-11-02)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
`service/email`: Updates service API and documentation
|
||||
* `service/email`: Updates service API and documentation
|
||||
|
||||
Release v1.5.0 (2016-11-01)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
`service/cloudformation`: Updates service API and documentation
|
||||
`service/ecr`: Updates service paginators
|
||||
* `service/cloudformation`: Updates service API and documentation
|
||||
* `service/ecr`: Updates service paginators
|
||||
|
||||
SDK Feature Updates
|
||||
---
|
||||
|
5
vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md
generated
vendored
Normal file
5
vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
### SDK Features
|
||||
|
||||
### SDK Enhancements
|
||||
|
||||
### SDK Bugs
|
127
vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md
generated
vendored
Normal file
127
vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md
generated
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
Contributing to the AWS SDK for Go
|
||||
|
||||
We work hard to provide a high-quality and useful SDK, and we greatly value
|
||||
feedback and contributions from our community. Whether it's a bug report,
|
||||
new feature, correction, or additional documentation, we welcome your issues
|
||||
and pull requests. Please read through this document before submitting any
|
||||
issues or pull requests to ensure we have all the necessary information to
|
||||
effectively respond to your bug report or contribution.
|
||||
|
||||
|
||||
## Filing Bug Reports
|
||||
|
||||
You can file bug reports against the SDK on the [GitHub issues][issues] page.
|
||||
|
||||
If you are filing a report for a bug or regression in the SDK, it's extremely
|
||||
helpful to provide as much information as possible when opening the original
|
||||
issue. This helps us reproduce and investigate the possible bug without having
|
||||
to wait for this extra information to be provided. Please read the following
|
||||
guidelines prior to filing a bug report.
|
||||
|
||||
1. Search through existing [issues][] to ensure that your specific issue has
|
||||
not yet been reported. If it is a common issue, it is likely there is
|
||||
already a bug report for your problem.
|
||||
|
||||
2. Ensure that you have tested the latest version of the SDK. Although you
|
||||
may have an issue against an older version of the SDK, we cannot provide
|
||||
bug fixes for old versions. It's also possible that the bug may have been
|
||||
fixed in the latest release.
|
||||
|
||||
3. Provide as much information about your environment, SDK version, and
|
||||
relevant dependencies as possible. For example, let us know what version
|
||||
of Go you are using, which and version of the operating system, and the
|
||||
the environment your code is running in. e.g Container.
|
||||
|
||||
4. Provide a minimal test case that reproduces your issue or any error
|
||||
information you related to your problem. We can provide feedback much
|
||||
more quickly if we know what operations you are calling in the SDK. If
|
||||
you cannot provide a full test case, provide as much code as you can
|
||||
to help us diagnose the problem. Any relevant information should be provided
|
||||
as well, like whether this is a persistent issue, or if it only occurs
|
||||
some of the time.
|
||||
|
||||
|
||||
## Submitting Pull Requests
|
||||
|
||||
We are always happy to receive code and documentation contributions to the SDK.
|
||||
Please be aware of the following notes prior to opening a pull request:
|
||||
|
||||
1. The SDK is released under the [Apache license][license]. Any code you submit
|
||||
will be released under that license. For substantial contributions, we may
|
||||
ask you to sign a [Contributor License Agreement (CLA)][cla].
|
||||
|
||||
2. If you would like to implement support for a significant feature that is not
|
||||
yet available in the SDK, please talk to us beforehand to avoid any
|
||||
duplication of effort.
|
||||
|
||||
3. Wherever possible, pull requests should contain tests as appropriate.
|
||||
Bugfixes should contain tests that exercise the corrected behavior (i.e., the
|
||||
test should fail without the bugfix and pass with it), and new features
|
||||
should be accompanied by tests exercising the feature.
|
||||
|
||||
4. Pull requests that contain failing tests will not be merged until the test
|
||||
failures are addressed. Pull requests that cause a significant drop in the
|
||||
SDK's test coverage percentage are unlikely to be merged until tests have
|
||||
been added.
|
||||
|
||||
5. The JSON files under the SDK's `models` folder are sourced from outside the SDK.
|
||||
Such as `models/apis/ec2/2016-11-15/api.json`. We will not accept pull requests
|
||||
directly on these models. If you discover an issue with the models please
|
||||
create a Github [issue](issues) describing the issue.
|
||||
|
||||
### Testing
|
||||
|
||||
To run the tests locally, running the `make unit` command will `go get` the
|
||||
SDK's testing dependencies, and run vet, link and unit tests for the SDK.
|
||||
|
||||
```
|
||||
make unit
|
||||
```
|
||||
|
||||
Standard go testing functionality is supported as well. To test SDK code that
|
||||
is tagged with `codegen` you'll need to set the build tag in the go test
|
||||
command. The `make unit` command will do this automatically.
|
||||
|
||||
```
|
||||
go test -tags codegen ./private/...
|
||||
```
|
||||
|
||||
See the `Makefile` for additional testing tags that can be used in testing.
|
||||
|
||||
To test on multiple platform the SDK includes several DockerFiles under the
|
||||
`awstesting/sandbox` folder, and associated make recipes to to execute
|
||||
unit testing within environments configured for specific Go versions.
|
||||
|
||||
```
|
||||
make sandbox-test-go18
|
||||
```
|
||||
|
||||
To run all sandbox environments use the following make recipe
|
||||
|
||||
```
|
||||
# Optionally update the Go tip that will be used during the batch testing
|
||||
make update-aws-golang-tip
|
||||
|
||||
# Run all SDK tests for supported Go versions in sandboxes
|
||||
make sandbox-test
|
||||
```
|
||||
|
||||
In addition the sandbox environment include make recipes for interactive modes
|
||||
so you can run command within the Docker container and context of the SDK.
|
||||
|
||||
```
|
||||
make sandbox-go18
|
||||
```
|
||||
|
||||
### Changelog
|
||||
|
||||
You can see all release changes in the `CHANGELOG.md` file at the root of the
|
||||
repository. The release notes added to this file will contain service client
|
||||
updates, and major SDK changes.
|
||||
|
||||
[issues]: https://github.com/aws/aws-sdk-go/issues
|
||||
[pr]: https://github.com/aws/aws-sdk-go/pulls
|
||||
[license]: http://aws.amazon.com/apache2.0/
|
||||
[cla]: http://en.wikipedia.org/wiki/Contributor_License_Agreement
|
||||
[releasenotes]: https://github.com/aws/aws-sdk-go/releases
|
||||
|
6
vendor/github.com/aws/aws-sdk-go/Gemfile
generated
vendored
6
vendor/github.com/aws/aws-sdk-go/Gemfile
generated
vendored
@ -1,6 +0,0 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'yard', git: 'git://github.com/lsegal/yard', ref: '5025564a491e1b7c6192632cba2802202ca08449'
|
||||
gem 'yard-go', git: 'git://github.com/jasdel/yard-go', ref: 'e78e1ef7cdf5e0f3266845b26bb4fd64f1dd6f85'
|
||||
gem 'rdiscount'
|
||||
|
44
vendor/github.com/aws/aws-sdk-go/Makefile
generated
vendored
44
vendor/github.com/aws/aws-sdk-go/Makefile
generated
vendored
@ -2,7 +2,7 @@ LINTIGNOREDOT='awstesting/integration.+should not use dot imports'
|
||||
LINTIGNOREDOC='service/[^/]+/(api|service|waiters)\.go:.+(comment on exported|should have comment or be unexported)'
|
||||
LINTIGNORECONST='service/[^/]+/(api|service|waiters)\.go:.+(type|struct field|const|func) ([^ ]+) should be ([^ ]+)'
|
||||
LINTIGNORESTUTTER='service/[^/]+/(api|service)\.go:.+(and that stutters)'
|
||||
LINTIGNOREINFLECT='service/[^/]+/(api|service)\.go:.+method .+ should be '
|
||||
LINTIGNOREINFLECT='service/[^/]+/(api|errors|service)\.go:.+(method|const) .+ should be '
|
||||
LINTIGNOREINFLECTS3UPLOAD='service/s3/s3manager/upload\.go:.+struct field SSEKMSKeyId should be '
|
||||
LINTIGNOREDEPS='vendor/.+\.go'
|
||||
UNIT_TEST_TAGS="example codegen"
|
||||
@ -45,7 +45,7 @@ gen-protocol-test:
|
||||
go generate ./private/protocol/...
|
||||
|
||||
gen-endpoints:
|
||||
go generate ./private/endpoints
|
||||
go generate ./models/endpoints/
|
||||
|
||||
build:
|
||||
@echo "go build SDK and vendor packages"
|
||||
@ -70,35 +70,53 @@ smoke-tests: get-deps-tests
|
||||
performance: get-deps-tests
|
||||
AWS_TESTING_LOG_RESULTS=${log-detailed} AWS_TESTING_REGION=$(region) AWS_TESTING_DB_TABLE=$(table) gucumber -go-tags "integration" ./awstesting/performance
|
||||
|
||||
sandbox-tests: sandbox-test-go14 sandbox-test-go15 sandbox-test-go15-novendorexp sandbox-test-go16 sandbox-test-go17 sandbox-test-gotip
|
||||
sandbox-tests: sandbox-test-go15 sandbox-test-go15-novendorexp sandbox-test-go16 sandbox-test-go17 sandbox-test-go18 sandbox-test-gotip
|
||||
|
||||
sandbox-test-go14:
|
||||
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.4 -t "aws-sdk-go-1.4" .
|
||||
docker run -t aws-sdk-go-1.4
|
||||
|
||||
sandbox-test-go15:
|
||||
sandbox-build-go15:
|
||||
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.5 -t "aws-sdk-go-1.5" .
|
||||
sandbox-go15: sandbox-build-go15
|
||||
docker run -i -t aws-sdk-go-1.5 bash
|
||||
sandbox-test-go15: sandbox-build-go15
|
||||
docker run -t aws-sdk-go-1.5
|
||||
|
||||
sandbox-test-go15-novendorexp:
|
||||
sandbox-build-go15-novendorexp:
|
||||
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.5-novendorexp -t "aws-sdk-go-1.5-novendorexp" .
|
||||
sandbox-go15-novendorexp: sandbox-build-go15-novendorexp
|
||||
docker run -i -t aws-sdk-go-1.5-novendorexp bash
|
||||
sandbox-test-go15-novendorexp: sandbox-build-go15-novendorexp
|
||||
docker run -t aws-sdk-go-1.5-novendorexp
|
||||
|
||||
sandbox-test-go16:
|
||||
sandbox-build-go16:
|
||||
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.6 -t "aws-sdk-go-1.6" .
|
||||
sandbox-go16: sandbox-build-go16
|
||||
docker run -i -t aws-sdk-go-1.6 bash
|
||||
sandbox-test-go16: sandbox-build-go16
|
||||
docker run -t aws-sdk-go-1.6
|
||||
|
||||
sandbox-test-go17:
|
||||
sandbox-build-go17:
|
||||
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.7 -t "aws-sdk-go-1.7" .
|
||||
sandbox-go17: sandbox-build-go17
|
||||
docker run -i -t aws-sdk-go-1.7 bash
|
||||
sandbox-test-go17: sandbox-build-go17
|
||||
docker run -t aws-sdk-go-1.7
|
||||
|
||||
sandbox-test-gotip:
|
||||
sandbox-build-go18:
|
||||
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.8 -t "aws-sdk-go-1.8" .
|
||||
sandbox-go18: sandbox-build-go18
|
||||
docker run -i -t aws-sdk-go-1.8 bash
|
||||
sandbox-test-go18: sandbox-build-go18
|
||||
docker run -t aws-sdk-go-1.8
|
||||
|
||||
sandbox-build-gotip:
|
||||
@echo "Run make update-aws-golang-tip, if this test fails because missing aws-golang:tip container"
|
||||
docker build -f ./awstesting/sandbox/Dockerfile.test.gotip -t "aws-sdk-go-tip" .
|
||||
sandbox-gotip: sandbox-build-gotip
|
||||
docker run -i -t aws-sdk-go-tip bash
|
||||
sandbox-test-gotip: sandbox-build-gotip
|
||||
docker run -t aws-sdk-go-tip
|
||||
|
||||
update-aws-golang-tip:
|
||||
docker build -f ./awstesting/sandbox/Dockerfile.golang-tip -t "aws-golang:tip" .
|
||||
docker build --no-cache=true -f ./awstesting/sandbox/Dockerfile.golang-tip -t "aws-golang:tip" .
|
||||
|
||||
verify: get-deps-verify lint vet
|
||||
|
||||
|
101
vendor/github.com/aws/aws-sdk-go/README.md
generated
vendored
101
vendor/github.com/aws/aws-sdk-go/README.md
generated
vendored
@ -1,11 +1,4 @@
|
||||
# AWS SDK for Go
|
||||
|
||||
<span style="display: inline-block;">
|
||||
[](http://docs.aws.amazon.com/sdk-for-go/api)
|
||||
[](https://gitter.im/aws/aws-sdk-go?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://travis-ci.org/aws/aws-sdk-go)
|
||||
[](https://github.com/aws/aws-sdk-go/blob/master/LICENSE.txt)
|
||||
</span>
|
||||
# AWS SDK for Go [](http://docs.aws.amazon.com/sdk-for-go/api) [](https://gitter.im/aws/aws-sdk-go?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://travis-ci.org/aws/aws-sdk-go) [](https://github.com/aws/aws-sdk-go/blob/master/LICENSE.txt)
|
||||
|
||||
aws-sdk-go is the official AWS SDK for the Go programming language.
|
||||
|
||||
@ -30,7 +23,22 @@ These two processes will still include the `vendor` folder and it should be dele
|
||||
|
||||
rm -rf $GOPATH/src/github.com/aws/aws-sdk-go/vendor
|
||||
|
||||
## Getting Help
|
||||
|
||||
Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests.
|
||||
* Ask a question on [StackOverflow](http://stackoverflow.com/) and tag it with the [`aws-sdk-go`](http://stackoverflow.com/questions/tagged/aws-sdk-go) tag.
|
||||
* Come join the AWS SDK for Go community chat on [gitter](https://gitter.im/aws/aws-sdk-go).
|
||||
* Open a support ticket with [AWS Support](http://docs.aws.amazon.com/awssupport/latest/user/getting-started.html).
|
||||
* If you think you may of found a bug, please open an [issue](https://github.com/aws/aws-sdk-go/issues/new).
|
||||
|
||||
## Opening Issues
|
||||
|
||||
If you encounter a bug with the AWS SDK for Go we would like to hear about it. Search the [existing issues]( https://github.com/aws/aws-sdk-go/issues) and see if others are also experiencing the issue before opening a new issue. Please include the version of AWS SDK for Go, Go language, and OS you’re using. Please also include repro case when appropriate.
|
||||
|
||||
The GitHub issues are intended for bug reports and feature requests. For help and questions with using AWS SDK for GO please make use of the resources listed in the [Getting Help]( https://github.com/aws/aws-sdk-go#getting-help) section. Keeping the list of open issues lean will help us respond in a timely manner.
|
||||
|
||||
## Reference Documentation
|
||||
|
||||
[`Getting Started Guide`](https://aws.amazon.com/sdk-for-go/) - This document is a general introduction how to configure and make requests with the SDK. If this is your first time using the SDK, this documentation and the API documentation will help you get started. This document focuses on the syntax and behavior of the SDK. The [Service Developer Guide](https://aws.amazon.com/documentation/) will help you get started using specific AWS services.
|
||||
|
||||
[`SDK API Reference Documentation`](https://docs.aws.amazon.com/sdk-for-go/api/) - Use this document to look up all API operation input and output parameters for AWS services supported by the SDK. The API reference also includes documentation of the SDK, and examples how to using the SDK, service client API operations, and API operation require parameters.
|
||||
@ -62,7 +70,7 @@ AWS_SECRET_ACCESS_KEY=MY-SECRET-KEY
|
||||
```
|
||||
|
||||
### AWS shared config file (`~/.aws/config`)
|
||||
The AWS SDK for Go added support the shared config file in release [v1.3.0](https://github.com/aws/aws-sdk-go/releases/tag/v1.3.0). You can opt into enabling support for the shared config by setting the environment variable `AWS_SDK_LOAD_CONFIG` to a truthy value. See the [Session](https://github.com/aws/aws-sdk-go/wiki/sessions) wiki for more information about this feature.
|
||||
The AWS SDK for Go added support the shared config file in release [v1.3.0](https://github.com/aws/aws-sdk-go/releases/tag/v1.3.0). You can opt into enabling support for the shared config by setting the environment variable `AWS_SDK_LOAD_CONFIG` to a truthy value. See the [Session](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/sessions.html) docs for more information about this feature.
|
||||
|
||||
## Using the Go SDK
|
||||
|
||||
@ -70,44 +78,77 @@ To use a service in the SDK, create a service variable by calling the `New()`
|
||||
function. Once you have a service client, you can call API operations which each
|
||||
return response data and a possible error.
|
||||
|
||||
To list a set of instance IDs from EC2, you could run:
|
||||
For example the following code shows how to upload an object to Amazon S3 with a Context timeout.
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/aws/aws-sdk-go/service/s3"
|
||||
)
|
||||
|
||||
// Uploads a file to S3 given a bucket and object key. Also takes a duration
|
||||
// value to terminate the update if it doesn't complete within that time.
|
||||
//
|
||||
// The AWS Region needs to be provided in the AWS shared config or on the
|
||||
// environment variable as `AWS_REGION`. Credentials also must be provided
|
||||
// Will default to shared config file, but can load from environment if provided.
|
||||
//
|
||||
// Usage:
|
||||
// # Upload myfile.txt to myBucket/myKey. Must complete within 10 minutes or will fail
|
||||
// go run withContext.go -b mybucket -k myKey -d 10m < myfile.txt
|
||||
func main() {
|
||||
sess, err := session.NewSession()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
var bucket, key string
|
||||
var timeout time.Duration
|
||||
|
||||
flag.StringVar(&bucket, "b", "", "Bucket name.")
|
||||
flag.StringVar(&key, "k", "", "Object key name.")
|
||||
flag.DurationVar(&timeout, "d", 0, "Upload timeout.")
|
||||
flag.Parse()
|
||||
|
||||
sess := session.Must(session.NewSession())
|
||||
svc := s3.New(sess)
|
||||
|
||||
// Create a context with a timeout that will abort the upload if it takes
|
||||
// more than the passed in timeout.
|
||||
ctx := context.Background()
|
||||
var cancelFn func()
|
||||
if timeout > 0 {
|
||||
ctx, cancelFn = context.WithTimeout(ctx, timeout)
|
||||
}
|
||||
// Ensure the context is canceled to prevent leaking.
|
||||
// See context package for more information, https://golang.org/pkg/context/
|
||||
defer cancelFn()
|
||||
|
||||
// Create an EC2 service object in the "us-west-2" region
|
||||
// Note that you can also configure your region globally by
|
||||
// exporting the AWS_REGION environment variable
|
||||
svc := ec2.New(sess, &aws.Config{Region: aws.String("us-west-2")})
|
||||
|
||||
// Call the DescribeInstances Operation
|
||||
resp, err := svc.DescribeInstances(nil)
|
||||
// Uploads the object to S3. The Context will interrupt the request if the
|
||||
// timeout expires.
|
||||
_, err := svc.PutObjectWithContext(ctx, &s3.PutObjectInput{
|
||||
Bucket: aws.String(bucket),
|
||||
Key: aws.String(key),
|
||||
Body: os.Stdin,
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// resp has all of the response data, pull out instance IDs:
|
||||
fmt.Println("> Number of reservation sets: ", len(resp.Reservations))
|
||||
for idx, res := range resp.Reservations {
|
||||
fmt.Println(" > Number of instances: ", len(res.Instances))
|
||||
for _, inst := range resp.Reservations[idx].Instances {
|
||||
fmt.Println(" - Instance ID: ", *inst.InstanceId)
|
||||
if aerr, ok := err.(awserr.Error); ok && aerr.Code() == request.CanceledErrorCode {
|
||||
// If the SDK can determine the request or retry delay was canceled
|
||||
// by a context the CanceledErrorCode error code will be returned.
|
||||
fmt.Fprintf(os.Stderr, "upload canceled due to timeout, %v\n", err)
|
||||
} else {
|
||||
fmt.Fprintf(os.Stderr, "failed to upload object, %v\n", err)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Printf("successfully uploaded file to %s/%s\n", bucket, key)
|
||||
}
|
||||
```
|
||||
|
||||
|
15
vendor/github.com/aws/aws-sdk-go/aws/client/client.go
generated
vendored
15
vendor/github.com/aws/aws-sdk-go/aws/client/client.go
generated
vendored
@ -11,9 +11,11 @@ import (
|
||||
|
||||
// A Config provides configuration to a service client instance.
|
||||
type Config struct {
|
||||
Config *aws.Config
|
||||
Handlers request.Handlers
|
||||
Endpoint, SigningRegion string
|
||||
Config *aws.Config
|
||||
Handlers request.Handlers
|
||||
Endpoint string
|
||||
SigningRegion string
|
||||
SigningName string
|
||||
}
|
||||
|
||||
// ConfigProvider provides a generic way for a service client to receive
|
||||
@ -22,6 +24,13 @@ type ConfigProvider interface {
|
||||
ClientConfig(serviceName string, cfgs ...*aws.Config) Config
|
||||
}
|
||||
|
||||
// ConfigNoResolveEndpointProvider same as ConfigProvider except it will not
|
||||
// resolve the endpoint automatically. The service client's endpoint must be
|
||||
// provided via the aws.Config.Endpoint field.
|
||||
type ConfigNoResolveEndpointProvider interface {
|
||||
ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) Config
|
||||
}
|
||||
|
||||
// A Client implements the base client request and response handling
|
||||
// used by all service clients.
|
||||
type Client struct {
|
||||
|
37
vendor/github.com/aws/aws-sdk-go/aws/config.go
generated
vendored
37
vendor/github.com/aws/aws-sdk-go/aws/config.go
generated
vendored
@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||
"github.com/aws/aws-sdk-go/aws/endpoints"
|
||||
)
|
||||
|
||||
// UseServiceDefaultRetries instructs the config to use the service's own
|
||||
@ -21,9 +22,9 @@ type RequestRetryer interface{}
|
||||
//
|
||||
// // Create Session with MaxRetry configuration to be shared by multiple
|
||||
// // service clients.
|
||||
// sess, err := session.NewSession(&aws.Config{
|
||||
// sess := session.Must(session.NewSession(&aws.Config{
|
||||
// MaxRetries: aws.Int(3),
|
||||
// })
|
||||
// }))
|
||||
//
|
||||
// // Create S3 service client with a specific Region.
|
||||
// svc := s3.New(sess, &aws.Config{
|
||||
@ -48,6 +49,10 @@ type Config struct {
|
||||
// endpoint for a client.
|
||||
Endpoint *string
|
||||
|
||||
// The resolver to use for looking up endpoints for AWS service clients
|
||||
// to use based on region.
|
||||
EndpointResolver endpoints.Resolver
|
||||
|
||||
// The region to send requests to. This parameter is required and must
|
||||
// be configured globally or on a per-client basis unless otherwise
|
||||
// noted. A full list of regions is found in the "Regions and Endpoints"
|
||||
@ -149,7 +154,8 @@ type Config struct {
|
||||
// the EC2Metadata overriding the timeout for default credentials chain.
|
||||
//
|
||||
// Example:
|
||||
// sess, err := session.NewSession(aws.NewConfig().WithEC2MetadataDiableTimeoutOverride(true))
|
||||
// sess := session.Must(session.NewSession(aws.NewConfig()
|
||||
// .WithEC2MetadataDiableTimeoutOverride(true)))
|
||||
//
|
||||
// svc := s3.New(sess)
|
||||
//
|
||||
@ -169,7 +175,7 @@ type Config struct {
|
||||
//
|
||||
// Only supported with.
|
||||
//
|
||||
// sess, err := session.NewSession()
|
||||
// sess := session.Must(session.NewSession())
|
||||
//
|
||||
// svc := s3.New(sess, &aws.Config{
|
||||
// UseDualStack: aws.Bool(true),
|
||||
@ -181,13 +187,19 @@ type Config struct {
|
||||
// request delays. This value should only be used for testing. To adjust
|
||||
// the delay of a request see the aws/client.DefaultRetryer and
|
||||
// aws/request.Retryer.
|
||||
//
|
||||
// SleepDelay will prevent any Context from being used for canceling retry
|
||||
// delay of an API operation. It is recommended to not use SleepDelay at all
|
||||
// and specify a Retryer instead.
|
||||
SleepDelay func(time.Duration)
|
||||
|
||||
// DisableRestProtocolURICleaning will not clean the URL path when making rest protocol requests.
|
||||
// Will default to false. This would only be used for empty directory names in s3 requests.
|
||||
//
|
||||
// Example:
|
||||
// sess, err := session.NewSession(&aws.Config{DisableRestProtocolURICleaning: aws.Bool(true))
|
||||
// sess := session.Must(session.NewSession(&aws.Config{
|
||||
// DisableRestProtocolURICleaning: aws.Bool(true),
|
||||
// }))
|
||||
//
|
||||
// svc := s3.New(sess)
|
||||
// out, err := svc.GetObject(&s3.GetObjectInput {
|
||||
@ -202,9 +214,9 @@ type Config struct {
|
||||
//
|
||||
// // Create Session with MaxRetry configuration to be shared by multiple
|
||||
// // service clients.
|
||||
// sess, err := session.NewSession(aws.NewConfig().
|
||||
// sess := session.Must(session.NewSession(aws.NewConfig().
|
||||
// WithMaxRetries(3),
|
||||
// )
|
||||
// ))
|
||||
//
|
||||
// // Create S3 service client with a specific Region.
|
||||
// svc := s3.New(sess, aws.NewConfig().
|
||||
@ -235,6 +247,13 @@ func (c *Config) WithEndpoint(endpoint string) *Config {
|
||||
return c
|
||||
}
|
||||
|
||||
// WithEndpointResolver sets a config EndpointResolver value returning a
|
||||
// Config pointer for chaining.
|
||||
func (c *Config) WithEndpointResolver(resolver endpoints.Resolver) *Config {
|
||||
c.EndpointResolver = resolver
|
||||
return c
|
||||
}
|
||||
|
||||
// WithRegion sets a config Region value returning a Config pointer for
|
||||
// chaining.
|
||||
func (c *Config) WithRegion(region string) *Config {
|
||||
@ -357,6 +376,10 @@ func mergeInConfig(dst *Config, other *Config) {
|
||||
dst.Endpoint = other.Endpoint
|
||||
}
|
||||
|
||||
if other.EndpointResolver != nil {
|
||||
dst.EndpointResolver = other.EndpointResolver
|
||||
}
|
||||
|
||||
if other.Region != nil {
|
||||
dst.Region = other.Region
|
||||
}
|
||||
|
71
vendor/github.com/aws/aws-sdk-go/aws/context.go
generated
vendored
Normal file
71
vendor/github.com/aws/aws-sdk-go/aws/context.go
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
package aws
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Context is an copy of the Go v1.7 stdlib's context.Context interface.
|
||||
// It is represented as a SDK interface to enable you to use the "WithContext"
|
||||
// API methods with Go v1.6 and a Context type such as golang.org/x/net/context.
|
||||
//
|
||||
// See https://golang.org/pkg/context on how to use contexts.
|
||||
type Context interface {
|
||||
// Deadline returns the time when work done on behalf of this context
|
||||
// should be canceled. Deadline returns ok==false when no deadline is
|
||||
// set. Successive calls to Deadline return the same results.
|
||||
Deadline() (deadline time.Time, ok bool)
|
||||
|
||||
// Done returns a channel that's closed when work done on behalf of this
|
||||
// context should be canceled. Done may return nil if this context can
|
||||
// never be canceled. Successive calls to Done return the same value.
|
||||
Done() <-chan struct{}
|
||||
|
||||
// Err returns a non-nil error value after Done is closed. Err returns
|
||||
// Canceled if the context was canceled or DeadlineExceeded if the
|
||||
// context's deadline passed. No other values for Err are defined.
|
||||
// After Done is closed, successive calls to Err return the same value.
|
||||
Err() error
|
||||
|
||||
// Value returns the value associated with this context for key, or nil
|
||||
// if no value is associated with key. Successive calls to Value with
|
||||
// the same key returns the same result.
|
||||
//
|
||||
// Use context values only for request-scoped data that transits
|
||||
// processes and API boundaries, not for passing optional parameters to
|
||||
// functions.
|
||||
Value(key interface{}) interface{}
|
||||
}
|
||||
|
||||
// BackgroundContext returns a context that will never be canceled, has no
|
||||
// values, and no deadline. This context is used by the SDK to provide
|
||||
// backwards compatibility with non-context API operations and functionality.
|
||||
//
|
||||
// Go 1.6 and before:
|
||||
// This context function is equivalent to context.Background in the Go stdlib.
|
||||
//
|
||||
// Go 1.7 and later:
|
||||
// The context returned will be the value returned by context.Background()
|
||||
//
|
||||
// See https://golang.org/pkg/context for more information on Contexts.
|
||||
func BackgroundContext() Context {
|
||||
return backgroundCtx
|
||||
}
|
||||
|
||||
// SleepWithContext will wait for the timer duration to expire, or the context
|
||||
// is canceled. Which ever happens first. If the context is canceled the Context's
|
||||
// error will be returned.
|
||||
//
|
||||
// Expects Context to always return a non-nil error if the Done channel is closed.
|
||||
func SleepWithContext(ctx Context, dur time.Duration) error {
|
||||
t := time.NewTimer(dur)
|
||||
defer t.Stop()
|
||||
|
||||
select {
|
||||
case <-t.C:
|
||||
break
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
41
vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go
generated
vendored
Normal file
41
vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
// +build !go1.7
|
||||
|
||||
package aws
|
||||
|
||||
import "time"
|
||||
|
||||
// An emptyCtx is a copy of the the Go 1.7 context.emptyCtx type. This
|
||||
// is copied to provide a 1.6 and 1.5 safe version of context that is compatible
|
||||
// with Go 1.7's Context.
|
||||
//
|
||||
// An emptyCtx is never canceled, has no values, and has no deadline. It is not
|
||||
// struct{}, since vars of this type must have distinct addresses.
|
||||
type emptyCtx int
|
||||
|
||||
func (*emptyCtx) Deadline() (deadline time.Time, ok bool) {
|
||||
return
|
||||
}
|
||||
|
||||
func (*emptyCtx) Done() <-chan struct{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*emptyCtx) Err() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*emptyCtx) Value(key interface{}) interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *emptyCtx) String() string {
|
||||
switch e {
|
||||
case backgroundCtx:
|
||||
return "aws.BackgroundContext"
|
||||
}
|
||||
return "unknown empty Context"
|
||||
}
|
||||
|
||||
var (
|
||||
backgroundCtx = new(emptyCtx)
|
||||
)
|
9
vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go
generated
vendored
Normal file
9
vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// +build go1.7
|
||||
|
||||
package aws
|
||||
|
||||
import "context"
|
||||
|
||||
var (
|
||||
backgroundCtx = context.Background()
|
||||
)
|
23
vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
generated
vendored
23
vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
generated
vendored
@ -71,7 +71,7 @@ var reStatusCode = regexp.MustCompile(`^(\d{3})`)
|
||||
|
||||
// ValidateReqSigHandler is a request handler to ensure that the request's
|
||||
// signature doesn't expire before it is sent. This can happen when a request
|
||||
// is built and signed signficantly before it is sent. Or signficant delays
|
||||
// is built and signed signficantly before it is sent. Or significant delays
|
||||
// occur whne retrying requests that would cause the signature to expire.
|
||||
var ValidateReqSigHandler = request.NamedHandler{
|
||||
Name: "core.ValidateReqSigHandler",
|
||||
@ -134,6 +134,16 @@ var SendHandler = request.NamedHandler{Name: "core.SendHandler", Fn: func(r *req
|
||||
// Catch all other request errors.
|
||||
r.Error = awserr.New("RequestError", "send request failed", err)
|
||||
r.Retryable = aws.Bool(true) // network errors are retryable
|
||||
|
||||
// Override the error with a context canceled error, if that was canceled.
|
||||
ctx := r.Context()
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
r.Error = awserr.New(request.CanceledErrorCode,
|
||||
"request context canceled", ctx.Err())
|
||||
r.Retryable = aws.Bool(false)
|
||||
default:
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
@ -156,7 +166,16 @@ var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn:
|
||||
|
||||
if r.WillRetry() {
|
||||
r.RetryDelay = r.RetryRules(r)
|
||||
r.Config.SleepDelay(r.RetryDelay)
|
||||
|
||||
if sleepFn := r.Config.SleepDelay; sleepFn != nil {
|
||||
// Support SleepDelay for backwards compatibility and testing
|
||||
sleepFn(r.RetryDelay)
|
||||
} else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil {
|
||||
r.Error = awserr.New(request.CanceledErrorCode,
|
||||
"request context canceled", err)
|
||||
r.Retryable = aws.Bool(false)
|
||||
return
|
||||
}
|
||||
|
||||
// when the expired token exception occurs the credentials
|
||||
// need to be expired locally so that the next request to
|
||||
|
2
vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
generated
vendored
@ -88,7 +88,7 @@ type Value struct {
|
||||
// The Provider should not need to implement its own mutexes, because
|
||||
// that will be managed by Credentials.
|
||||
type Provider interface {
|
||||
// Refresh returns nil if it successfully retrieved the value.
|
||||
// Retrieve returns nil if it successfully retrieved the value.
|
||||
// Error is returned if the value were not obtainable, or empty.
|
||||
Retrieve() (Value, error)
|
||||
|
||||
|
159
vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
generated
vendored
159
vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
generated
vendored
@ -1,7 +1,81 @@
|
||||
// Package stscreds are credential Providers to retrieve STS AWS credentials.
|
||||
//
|
||||
// STS provides multiple ways to retrieve credentials which can be used when making
|
||||
// future AWS service API operation calls.
|
||||
/*
|
||||
Package stscreds are credential Providers to retrieve STS AWS credentials.
|
||||
|
||||
STS provides multiple ways to retrieve credentials which can be used when making
|
||||
future AWS service API operation calls.
|
||||
|
||||
The SDK will ensure that per instance of credentials.Credentials all requests
|
||||
to refresh the credentials will be synchronized. But, the SDK is unable to
|
||||
ensure synchronous usage of the AssumeRoleProvider if the value is shared
|
||||
between multiple Credentials, Sessions or service clients.
|
||||
|
||||
Assume Role
|
||||
|
||||
To assume an IAM role using STS with the SDK you can create a new Credentials
|
||||
with the SDKs's stscreds package.
|
||||
|
||||
// Initial credentials loaded from SDK's default credential chain. Such as
|
||||
// the environment, shared credentials (~/.aws/credentials), or EC2 Instance
|
||||
// Role. These credentials will be used to to make the STS Assume Role API.
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
// Create the credentials from AssumeRoleProvider to assume the role
|
||||
// referenced by the "myRoleARN" ARN.
|
||||
creds := stscreds.NewCredentials(sess, "myRoleArn")
|
||||
|
||||
// Create service client value configured for credentials
|
||||
// from assumed role.
|
||||
svc := s3.New(sess, &aws.Config{Credentials: creds})
|
||||
|
||||
Assume Role with static MFA Token
|
||||
|
||||
To assume an IAM role with a MFA token you can either specify a MFA token code
|
||||
directly or provide a function to prompt the user each time the credentials
|
||||
need to refresh the role's credentials. Specifying the TokenCode should be used
|
||||
for short lived operations that will not need to be refreshed, and when you do
|
||||
not want to have direct control over the user provides their MFA token.
|
||||
|
||||
With TokenCode the AssumeRoleProvider will be not be able to refresh the role's
|
||||
credentials.
|
||||
|
||||
// Create the credentials from AssumeRoleProvider to assume the role
|
||||
// referenced by the "myRoleARN" ARN using the MFA token code provided.
|
||||
creds := stscreds.NewCredentials(sess, "myRoleArn", func(p *stscreds.AssumeRoleProvider) {
|
||||
p.SerialNumber = aws.String("myTokenSerialNumber")
|
||||
p.TokenCode = aws.String("00000000")
|
||||
})
|
||||
|
||||
// Create service client value configured for credentials
|
||||
// from assumed role.
|
||||
svc := s3.New(sess, &aws.Config{Credentials: creds})
|
||||
|
||||
Assume Role with MFA Token Provider
|
||||
|
||||
To assume an IAM role with MFA for longer running tasks where the credentials
|
||||
may need to be refreshed setting the TokenProvider field of AssumeRoleProvider
|
||||
will allow the credential provider to prompt for new MFA token code when the
|
||||
role's credentials need to be refreshed.
|
||||
|
||||
The StdinTokenProvider function is available to prompt on stdin to retrieve
|
||||
the MFA token code from the user. You can also implement custom prompts by
|
||||
satisfing the TokenProvider function signature.
|
||||
|
||||
Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will
|
||||
have undesirable results as the StdinTokenProvider will not be synchronized. A
|
||||
single Credentials with an AssumeRoleProvider can be shared safely.
|
||||
|
||||
// Create the credentials from AssumeRoleProvider to assume the role
|
||||
// referenced by the "myRoleARN" ARN. Prompting for MFA token from stdin.
|
||||
creds := stscreds.NewCredentials(sess, "myRoleArn", func(p *stscreds.AssumeRoleProvider) {
|
||||
p.SerialNumber = aws.String("myTokenSerialNumber")
|
||||
p.TokenProvider = stscreds.StdinTokenProvider
|
||||
})
|
||||
|
||||
// Create service client value configured for credentials
|
||||
// from assumed role.
|
||||
svc := s3.New(sess, &aws.Config{Credentials: creds})
|
||||
|
||||
*/
|
||||
package stscreds
|
||||
|
||||
import (
|
||||
@ -9,11 +83,31 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||
"github.com/aws/aws-sdk-go/service/sts"
|
||||
)
|
||||
|
||||
// StdinTokenProvider will prompt on stdout and read from stdin for a string value.
|
||||
// An error is returned if reading from stdin fails.
|
||||
//
|
||||
// Use this function go read MFA tokens from stdin. The function makes no attempt
|
||||
// to make atomic prompts from stdin across multiple gorouties.
|
||||
//
|
||||
// Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will
|
||||
// have undesirable results as the StdinTokenProvider will not be synchronized. A
|
||||
// single Credentials with an AssumeRoleProvider can be shared safely
|
||||
//
|
||||
// Will wait forever until something is provided on the stdin.
|
||||
func StdinTokenProvider() (string, error) {
|
||||
var v string
|
||||
fmt.Printf("Assume Role MFA token code: ")
|
||||
_, err := fmt.Scanln(&v)
|
||||
|
||||
return v, err
|
||||
}
|
||||
|
||||
// ProviderName provides a name of AssumeRole provider
|
||||
const ProviderName = "AssumeRoleProvider"
|
||||
|
||||
@ -27,8 +121,15 @@ type AssumeRoler interface {
|
||||
var DefaultDuration = time.Duration(15) * time.Minute
|
||||
|
||||
// AssumeRoleProvider retrieves temporary credentials from the STS service, and
|
||||
// keeps track of their expiration time. This provider must be used explicitly,
|
||||
// as it is not included in the credentials chain.
|
||||
// keeps track of their expiration time.
|
||||
//
|
||||
// This credential provider will be used by the SDKs default credential change
|
||||
// when shared configuration is enabled, and the shared config or shared credentials
|
||||
// file configure assume role. See Session docs for how to do this.
|
||||
//
|
||||
// AssumeRoleProvider does not provide any synchronization and it is not safe
|
||||
// to share this value across multiple Credentials, Sessions, or service clients
|
||||
// without also sharing the same Credentials instance.
|
||||
type AssumeRoleProvider struct {
|
||||
credentials.Expiry
|
||||
|
||||
@ -65,8 +166,23 @@ type AssumeRoleProvider struct {
|
||||
// assumed requires MFA (that is, if the policy includes a condition that tests
|
||||
// for MFA). If the role being assumed requires MFA and if the TokenCode value
|
||||
// is missing or expired, the AssumeRole call returns an "access denied" error.
|
||||
//
|
||||
// If SerialNumber is set and neither TokenCode nor TokenProvider are also
|
||||
// set an error will be returned.
|
||||
TokenCode *string
|
||||
|
||||
// Async method of providing MFA token code for assuming an IAM role with MFA.
|
||||
// The value returned by the function will be used as the TokenCode in the Retrieve
|
||||
// call. See StdinTokenProvider for a provider that prompts and reads from stdin.
|
||||
//
|
||||
// This token provider will be called when ever the assumed role's
|
||||
// credentials need to be refreshed when SerialNumber is also set and
|
||||
// TokenCode is not set.
|
||||
//
|
||||
// If both TokenCode and TokenProvider is set, TokenProvider will be used and
|
||||
// TokenCode is ignored.
|
||||
TokenProvider func() (string, error)
|
||||
|
||||
// ExpiryWindow will allow the credentials to trigger refreshing prior to
|
||||
// the credentials actually expiring. This is beneficial so race conditions
|
||||
// with expiring credentials do not cause request to fail unexpectedly
|
||||
@ -85,6 +201,10 @@ type AssumeRoleProvider struct {
|
||||
//
|
||||
// Takes a Config provider to create the STS client. The ConfigProvider is
|
||||
// satisfied by the session.Session type.
|
||||
//
|
||||
// It is safe to share the returned Credentials with multiple Sessions and
|
||||
// service clients. All access to the credentials and refreshing them
|
||||
// will be synchronized.
|
||||
func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
|
||||
p := &AssumeRoleProvider{
|
||||
Client: sts.New(c),
|
||||
@ -103,7 +223,11 @@ func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*As
|
||||
// AssumeRoleProvider. The credentials will expire every 15 minutes and the
|
||||
// role will be named after a nanosecond timestamp of this operation.
|
||||
//
|
||||
// Takes an AssumeRoler which can be satisfiede by the STS client.
|
||||
// Takes an AssumeRoler which can be satisfied by the STS client.
|
||||
//
|
||||
// It is safe to share the returned Credentials with multiple Sessions and
|
||||
// service clients. All access to the credentials and refreshing them
|
||||
// will be synchronized.
|
||||
func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
|
||||
p := &AssumeRoleProvider{
|
||||
Client: svc,
|
||||
@ -139,12 +263,25 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
|
||||
if p.Policy != nil {
|
||||
input.Policy = p.Policy
|
||||
}
|
||||
if p.SerialNumber != nil && p.TokenCode != nil {
|
||||
input.SerialNumber = p.SerialNumber
|
||||
input.TokenCode = p.TokenCode
|
||||
if p.SerialNumber != nil {
|
||||
if p.TokenCode != nil {
|
||||
input.SerialNumber = p.SerialNumber
|
||||
input.TokenCode = p.TokenCode
|
||||
} else if p.TokenProvider != nil {
|
||||
input.SerialNumber = p.SerialNumber
|
||||
code, err := p.TokenProvider()
|
||||
if err != nil {
|
||||
return credentials.Value{ProviderName: ProviderName}, err
|
||||
}
|
||||
input.TokenCode = aws.String(code)
|
||||
} else {
|
||||
return credentials.Value{ProviderName: ProviderName},
|
||||
awserr.New("AssumeRoleTokenNotAvailable",
|
||||
"assume role with MFA enabled, but neither TokenCode nor TokenProvider are set", nil)
|
||||
}
|
||||
}
|
||||
roleOutput, err := p.Client.AssumeRole(input)
|
||||
|
||||
roleOutput, err := p.Client.AssumeRole(input)
|
||||
if err != nil {
|
||||
return credentials.Value{ProviderName: ProviderName}, err
|
||||
}
|
||||
|
13
vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
generated
vendored
13
vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
generated
vendored
@ -19,8 +19,8 @@ import (
|
||||
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
|
||||
"github.com/aws/aws-sdk-go/aws/credentials/endpointcreds"
|
||||
"github.com/aws/aws-sdk-go/aws/ec2metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/endpoints"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/private/endpoints"
|
||||
)
|
||||
|
||||
// A Defaults provides a collection of default values for SDK clients.
|
||||
@ -56,7 +56,7 @@ func Config() *aws.Config {
|
||||
WithMaxRetries(aws.UseServiceDefaultRetries).
|
||||
WithLogger(aws.NewDefaultLogger()).
|
||||
WithLogLevel(aws.LogOff).
|
||||
WithSleepDelay(time.Sleep)
|
||||
WithEndpointResolver(endpoints.DefaultResolver())
|
||||
}
|
||||
|
||||
// Handlers returns the default request handlers.
|
||||
@ -120,11 +120,14 @@ func ecsCredProvider(cfg aws.Config, handlers request.Handlers, uri string) cred
|
||||
}
|
||||
|
||||
func ec2RoleProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider {
|
||||
endpoint, signingRegion := endpoints.EndpointForRegion(ec2metadata.ServiceName,
|
||||
aws.StringValue(cfg.Region), true, false)
|
||||
resolver := cfg.EndpointResolver
|
||||
if resolver == nil {
|
||||
resolver = endpoints.DefaultResolver()
|
||||
}
|
||||
|
||||
e, _ := resolver.EndpointFor(endpoints.Ec2metadataServiceID, "")
|
||||
return &ec2rolecreds.EC2RoleProvider{
|
||||
Client: ec2metadata.NewClient(cfg, handlers, endpoint, signingRegion),
|
||||
Client: ec2metadata.NewClient(cfg, handlers, e.URL, e.SigningRegion),
|
||||
ExpiryWindow: 5 * time.Minute,
|
||||
}
|
||||
}
|
||||
|
133
vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go
generated
vendored
Normal file
133
vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go
generated
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
package endpoints
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
)
|
||||
|
||||
type modelDefinition map[string]json.RawMessage
|
||||
|
||||
// A DecodeModelOptions are the options for how the endpoints model definition
|
||||
// are decoded.
|
||||
type DecodeModelOptions struct {
|
||||
SkipCustomizations bool
|
||||
}
|
||||
|
||||
// Set combines all of the option functions together.
|
||||
func (d *DecodeModelOptions) Set(optFns ...func(*DecodeModelOptions)) {
|
||||
for _, fn := range optFns {
|
||||
fn(d)
|
||||
}
|
||||
}
|
||||
|
||||
// DecodeModel unmarshals a Regions and Endpoint model definition file into
|
||||
// a endpoint Resolver. If the file format is not supported, or an error occurs
|
||||
// when unmarshaling the model an error will be returned.
|
||||
//
|
||||
// Casting the return value of this func to a EnumPartitions will
|
||||
// allow you to get a list of the partitions in the order the endpoints
|
||||
// will be resolved in.
|
||||
//
|
||||
// resolver, err := endpoints.DecodeModel(reader)
|
||||
//
|
||||
// partitions := resolver.(endpoints.EnumPartitions).Partitions()
|
||||
// for _, p := range partitions {
|
||||
// // ... inspect partitions
|
||||
// }
|
||||
func DecodeModel(r io.Reader, optFns ...func(*DecodeModelOptions)) (Resolver, error) {
|
||||
var opts DecodeModelOptions
|
||||
opts.Set(optFns...)
|
||||
|
||||
// Get the version of the partition file to determine what
|
||||
// unmarshaling model to use.
|
||||
modelDef := modelDefinition{}
|
||||
if err := json.NewDecoder(r).Decode(&modelDef); err != nil {
|
||||
return nil, newDecodeModelError("failed to decode endpoints model", err)
|
||||
}
|
||||
|
||||
var version string
|
||||
if b, ok := modelDef["version"]; ok {
|
||||
version = string(b)
|
||||
} else {
|
||||
return nil, newDecodeModelError("endpoints version not found in model", nil)
|
||||
}
|
||||
|
||||
if version == "3" {
|
||||
return decodeV3Endpoints(modelDef, opts)
|
||||
}
|
||||
|
||||
return nil, newDecodeModelError(
|
||||
fmt.Sprintf("endpoints version %s, not supported", version), nil)
|
||||
}
|
||||
|
||||
func decodeV3Endpoints(modelDef modelDefinition, opts DecodeModelOptions) (Resolver, error) {
|
||||
b, ok := modelDef["partitions"]
|
||||
if !ok {
|
||||
return nil, newDecodeModelError("endpoints model missing partitions", nil)
|
||||
}
|
||||
|
||||
ps := partitions{}
|
||||
if err := json.Unmarshal(b, &ps); err != nil {
|
||||
return nil, newDecodeModelError("failed to decode endpoints model", err)
|
||||
}
|
||||
|
||||
if opts.SkipCustomizations {
|
||||
return ps, nil
|
||||
}
|
||||
|
||||
// Customization
|
||||
for i := 0; i < len(ps); i++ {
|
||||
p := &ps[i]
|
||||
custAddEC2Metadata(p)
|
||||
custAddS3DualStack(p)
|
||||
custRmIotDataService(p)
|
||||
}
|
||||
|
||||
return ps, nil
|
||||
}
|
||||
|
||||
func custAddS3DualStack(p *partition) {
|
||||
if p.ID != "aws" {
|
||||
return
|
||||
}
|
||||
|
||||
s, ok := p.Services["s3"]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
s.Defaults.HasDualStack = boxedTrue
|
||||
s.Defaults.DualStackHostname = "{service}.dualstack.{region}.{dnsSuffix}"
|
||||
|
||||
p.Services["s3"] = s
|
||||
}
|
||||
|
||||
func custAddEC2Metadata(p *partition) {
|
||||
p.Services["ec2metadata"] = service{
|
||||
IsRegionalized: boxedFalse,
|
||||
PartitionEndpoint: "aws-global",
|
||||
Endpoints: endpoints{
|
||||
"aws-global": endpoint{
|
||||
Hostname: "169.254.169.254/latest",
|
||||
Protocols: []string{"http"},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func custRmIotDataService(p *partition) {
|
||||
delete(p.Services, "data.iot")
|
||||
}
|
||||
|
||||
type decodeModelError struct {
|
||||
awsError
|
||||
}
|
||||
|
||||
func newDecodeModelError(msg string, err error) decodeModelError {
|
||||
return decodeModelError{
|
||||
awsError: awserr.New("DecodeEndpointsModelError", msg, err),
|
||||
}
|
||||
}
|
2132
vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
generated
vendored
Normal file
2132
vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
66
vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go
generated
vendored
Normal file
66
vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
// Package endpoints provides the types and functionality for defining regions
|
||||
// and endpoints, as well as querying those definitions.
|
||||
//
|
||||
// The SDK's Regions and Endpoints metadata is code generated into the endpoints
|
||||
// package, and is accessible via the DefaultResolver function. This function
|
||||
// returns a endpoint Resolver will search the metadata and build an associated
|
||||
// endpoint if one is found. The default resolver will search all partitions
|
||||
// known by the SDK. e.g AWS Standard (aws), AWS China (aws-cn), and
|
||||
// AWS GovCloud (US) (aws-us-gov).
|
||||
// .
|
||||
//
|
||||
// Enumerating Regions and Endpoint Metadata
|
||||
//
|
||||
// Casting the Resolver returned by DefaultResolver to a EnumPartitions interface
|
||||
// will allow you to get access to the list of underlying Partitions with the
|
||||
// Partitions method. This is helpful if you want to limit the SDK's endpoint
|
||||
// resolving to a single partition, or enumerate regions, services, and endpoints
|
||||
// in the partition.
|
||||
//
|
||||
// resolver := endpoints.DefaultResolver()
|
||||
// partitions := resolver.(endpoints.EnumPartitions).Partitions()
|
||||
//
|
||||
// for _, p := range partitions {
|
||||
// fmt.Println("Regions for", p.Name)
|
||||
// for id, _ := range p.Regions() {
|
||||
// fmt.Println("*", id)
|
||||
// }
|
||||
//
|
||||
// fmt.Println("Services for", p.Name)
|
||||
// for id, _ := range p.Services() {
|
||||
// fmt.Println("*", id)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Using Custom Endpoints
|
||||
//
|
||||
// The endpoints package also gives you the ability to use your own logic how
|
||||
// endpoints are resolved. This is a great way to define a custom endpoint
|
||||
// for select services, without passing that logic down through your code.
|
||||
//
|
||||
// If a type implements the Resolver interface it can be used to resolve
|
||||
// endpoints. To use this with the SDK's Session and Config set the value
|
||||
// of the type to the EndpointsResolver field of aws.Config when initializing
|
||||
// the session, or service client.
|
||||
//
|
||||
// In addition the ResolverFunc is a wrapper for a func matching the signature
|
||||
// of Resolver.EndpointFor, converting it to a type that satisfies the
|
||||
// Resolver interface.
|
||||
//
|
||||
//
|
||||
// myCustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) {
|
||||
// if service == endpoints.S3ServiceID {
|
||||
// return endpoints.ResolvedEndpoint{
|
||||
// URL: "s3.custom.endpoint.com",
|
||||
// SigningRegion: "custom-signing-region",
|
||||
// }, nil
|
||||
// }
|
||||
//
|
||||
// return endpoints.DefaultResolver().EndpointFor(service, region, optFns...)
|
||||
// }
|
||||
//
|
||||
// sess := session.Must(session.NewSession(&aws.Config{
|
||||
// Region: aws.String("us-west-2"),
|
||||
// EndpointResolver: endpoints.ResolverFunc(myCustomResolver),
|
||||
// }))
|
||||
package endpoints
|
397
vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go
generated
vendored
Normal file
397
vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go
generated
vendored
Normal file
@ -0,0 +1,397 @@
|
||||
package endpoints
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
)
|
||||
|
||||
// Options provide the configuration needed to direct how the
|
||||
// endpoints will be resolved.
|
||||
type Options struct {
|
||||
// DisableSSL forces the endpoint to be resolved as HTTP.
|
||||
// instead of HTTPS if the service supports it.
|
||||
DisableSSL bool
|
||||
|
||||
// Sets the resolver to resolve the endpoint as a dualstack endpoint
|
||||
// for the service. If dualstack support for a service is not known and
|
||||
// StrictMatching is not enabled a dualstack endpoint for the service will
|
||||
// be returned. This endpoint may not be valid. If StrictMatching is
|
||||
// enabled only services that are known to support dualstack will return
|
||||
// dualstack endpoints.
|
||||
UseDualStack bool
|
||||
|
||||
// Enables strict matching of services and regions resolved endpoints.
|
||||
// If the partition doesn't enumerate the exact service and region an
|
||||
// error will be returned. This option will prevent returning endpoints
|
||||
// that look valid, but may not resolve to any real endpoint.
|
||||
StrictMatching bool
|
||||
|
||||
// Enables resolving a service endpoint based on the region provided if the
|
||||
// service does not exist. The service endpoint ID will be used as the service
|
||||
// domain name prefix. By default the endpoint resolver requires the service
|
||||
// to be known when resolving endpoints.
|
||||
//
|
||||
// If resolving an endpoint on the partition list the provided region will
|
||||
// be used to determine which partition's domain name pattern to the service
|
||||
// endpoint ID with. If both the service and region are unkonwn and resolving
|
||||
// the endpoint on partition list an UnknownEndpointError error will be returned.
|
||||
//
|
||||
// If resolving and endpoint on a partition specific resolver that partition's
|
||||
// domain name pattern will be used with the service endpoint ID. If both
|
||||
// region and service do not exist when resolving an endpoint on a specific
|
||||
// partition the partition's domain pattern will be used to combine the
|
||||
// endpoint and region together.
|
||||
//
|
||||
// This option is ignored if StrictMatching is enabled.
|
||||
ResolveUnknownService bool
|
||||
}
|
||||
|
||||
// Set combines all of the option functions together.
|
||||
func (o *Options) Set(optFns ...func(*Options)) {
|
||||
for _, fn := range optFns {
|
||||
fn(o)
|
||||
}
|
||||
}
|
||||
|
||||
// DisableSSLOption sets the DisableSSL options. Can be used as a functional
|
||||
// option when resolving endpoints.
|
||||
func DisableSSLOption(o *Options) {
|
||||
o.DisableSSL = true
|
||||
}
|
||||
|
||||
// UseDualStackOption sets the UseDualStack option. Can be used as a functional
|
||||
// option when resolving endpoints.
|
||||
func UseDualStackOption(o *Options) {
|
||||
o.UseDualStack = true
|
||||
}
|
||||
|
||||
// StrictMatchingOption sets the StrictMatching option. Can be used as a functional
|
||||
// option when resolving endpoints.
|
||||
func StrictMatchingOption(o *Options) {
|
||||
o.StrictMatching = true
|
||||
}
|
||||
|
||||
// ResolveUnknownServiceOption sets the ResolveUnknownService option. Can be used
|
||||
// as a functional option when resolving endpoints.
|
||||
func ResolveUnknownServiceOption(o *Options) {
|
||||
o.ResolveUnknownService = true
|
||||
}
|
||||
|
||||
// A Resolver provides the interface for functionality to resolve endpoints.
|
||||
// The build in Partition and DefaultResolver return value satisfy this interface.
|
||||
type Resolver interface {
|
||||
EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error)
|
||||
}
|
||||
|
||||
// ResolverFunc is a helper utility that wraps a function so it satisfies the
|
||||
// Resolver interface. This is useful when you want to add additional endpoint
|
||||
// resolving logic, or stub out specific endpoints with custom values.
|
||||
type ResolverFunc func(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error)
|
||||
|
||||
// EndpointFor wraps the ResolverFunc function to satisfy the Resolver interface.
|
||||
func (fn ResolverFunc) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) {
|
||||
return fn(service, region, opts...)
|
||||
}
|
||||
|
||||
var schemeRE = regexp.MustCompile("^([^:]+)://")
|
||||
|
||||
// AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no
|
||||
// scheme. If disableSSL is true HTTP will set HTTP instead of the default HTTPS.
|
||||
//
|
||||
// If disableSSL is set, it will only set the URL's scheme if the URL does not
|
||||
// contain a scheme.
|
||||
func AddScheme(endpoint string, disableSSL bool) string {
|
||||
if !schemeRE.MatchString(endpoint) {
|
||||
scheme := "https"
|
||||
if disableSSL {
|
||||
scheme = "http"
|
||||
}
|
||||
endpoint = fmt.Sprintf("%s://%s", scheme, endpoint)
|
||||
}
|
||||
|
||||
return endpoint
|
||||
}
|
||||
|
||||
// EnumPartitions a provides a way to retrieve the underlying partitions that
|
||||
// make up the SDK's default Resolver, or any resolver decoded from a model
|
||||
// file.
|
||||
//
|
||||
// Use this interface with DefaultResolver and DecodeModels to get the list of
|
||||
// Partitions.
|
||||
type EnumPartitions interface {
|
||||
Partitions() []Partition
|
||||
}
|
||||
|
||||
// A Partition provides the ability to enumerate the partition's regions
|
||||
// and services.
|
||||
type Partition struct {
|
||||
id string
|
||||
p *partition
|
||||
}
|
||||
|
||||
// ID returns the identifier of the partition.
|
||||
func (p *Partition) ID() string { return p.id }
|
||||
|
||||
// EndpointFor attempts to resolve the endpoint based on service and region.
|
||||
// See Options for information on configuring how the endpoint is resolved.
|
||||
//
|
||||
// If the service cannot be found in the metadata the UnknownServiceError
|
||||
// error will be returned. This validation will occur regardless if
|
||||
// StrictMatching is enabled. To enable resolving unknown services set the
|
||||
// "ResolveUnknownService" option to true. When StrictMatching is disabled
|
||||
// this option allows the partition resolver to resolve a endpoint based on
|
||||
// the service endpoint ID provided.
|
||||
//
|
||||
// When resolving endpoints you can choose to enable StrictMatching. This will
|
||||
// require the provided service and region to be known by the partition.
|
||||
// If the endpoint cannot be strictly resolved an error will be returned. This
|
||||
// mode is useful to ensure the endpoint resolved is valid. Without
|
||||
// StrictMatching enabled the endpoint returned my look valid but may not work.
|
||||
// StrictMatching requires the SDK to be updated if you want to take advantage
|
||||
// of new regions and services expansions.
|
||||
//
|
||||
// Errors that can be returned.
|
||||
// * UnknownServiceError
|
||||
// * UnknownEndpointError
|
||||
func (p *Partition) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) {
|
||||
return p.p.EndpointFor(service, region, opts...)
|
||||
}
|
||||
|
||||
// Regions returns a map of Regions indexed by their ID. This is useful for
|
||||
// enumerating over the regions in a partition.
|
||||
func (p *Partition) Regions() map[string]Region {
|
||||
rs := map[string]Region{}
|
||||
for id := range p.p.Regions {
|
||||
rs[id] = Region{
|
||||
id: id,
|
||||
p: p.p,
|
||||
}
|
||||
}
|
||||
|
||||
return rs
|
||||
}
|
||||
|
||||
// Services returns a map of Service indexed by their ID. This is useful for
|
||||
// enumerating over the services in a partition.
|
||||
func (p *Partition) Services() map[string]Service {
|
||||
ss := map[string]Service{}
|
||||
for id := range p.p.Services {
|
||||
ss[id] = Service{
|
||||
id: id,
|
||||
p: p.p,
|
||||
}
|
||||
}
|
||||
|
||||
return ss
|
||||
}
|
||||
|
||||
// A Region provides information about a region, and ability to resolve an
|
||||
// endpoint from the context of a region, given a service.
|
||||
type Region struct {
|
||||
id, desc string
|
||||
p *partition
|
||||
}
|
||||
|
||||
// ID returns the region's identifier.
|
||||
func (r *Region) ID() string { return r.id }
|
||||
|
||||
// ResolveEndpoint resolves an endpoint from the context of the region given
|
||||
// a service. See Partition.EndpointFor for usage and errors that can be returned.
|
||||
func (r *Region) ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error) {
|
||||
return r.p.EndpointFor(service, r.id, opts...)
|
||||
}
|
||||
|
||||
// Services returns a list of all services that are known to be in this region.
|
||||
func (r *Region) Services() map[string]Service {
|
||||
ss := map[string]Service{}
|
||||
for id, s := range r.p.Services {
|
||||
if _, ok := s.Endpoints[r.id]; ok {
|
||||
ss[id] = Service{
|
||||
id: id,
|
||||
p: r.p,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ss
|
||||
}
|
||||
|
||||
// A Service provides information about a service, and ability to resolve an
|
||||
// endpoint from the context of a service, given a region.
|
||||
type Service struct {
|
||||
id string
|
||||
p *partition
|
||||
}
|
||||
|
||||
// ID returns the identifier for the service.
|
||||
func (s *Service) ID() string { return s.id }
|
||||
|
||||
// ResolveEndpoint resolves an endpoint from the context of a service given
|
||||
// a region. See Partition.EndpointFor for usage and errors that can be returned.
|
||||
func (s *Service) ResolveEndpoint(region string, opts ...func(*Options)) (ResolvedEndpoint, error) {
|
||||
return s.p.EndpointFor(s.id, region, opts...)
|
||||
}
|
||||
|
||||
// Endpoints returns a map of Endpoints indexed by their ID for all known
|
||||
// endpoints for a service.
|
||||
func (s *Service) Endpoints() map[string]Endpoint {
|
||||
es := map[string]Endpoint{}
|
||||
for id := range s.p.Services[s.id].Endpoints {
|
||||
es[id] = Endpoint{
|
||||
id: id,
|
||||
serviceID: s.id,
|
||||
p: s.p,
|
||||
}
|
||||
}
|
||||
|
||||
return es
|
||||
}
|
||||
|
||||
// A Endpoint provides information about endpoints, and provides the ability
|
||||
// to resolve that endpoint for the service, and the region the endpoint
|
||||
// represents.
|
||||
type Endpoint struct {
|
||||
id string
|
||||
serviceID string
|
||||
p *partition
|
||||
}
|
||||
|
||||
// ID returns the identifier for an endpoint.
|
||||
func (e *Endpoint) ID() string { return e.id }
|
||||
|
||||
// ServiceID returns the identifier the endpoint belongs to.
|
||||
func (e *Endpoint) ServiceID() string { return e.serviceID }
|
||||
|
||||
// ResolveEndpoint resolves an endpoint from the context of a service and
|
||||
// region the endpoint represents. See Partition.EndpointFor for usage and
|
||||
// errors that can be returned.
|
||||
func (e *Endpoint) ResolveEndpoint(opts ...func(*Options)) (ResolvedEndpoint, error) {
|
||||
return e.p.EndpointFor(e.serviceID, e.id, opts...)
|
||||
}
|
||||
|
||||
// A ResolvedEndpoint is an endpoint that has been resolved based on a partition
|
||||
// service, and region.
|
||||
type ResolvedEndpoint struct {
|
||||
// The endpoint URL
|
||||
URL string
|
||||
|
||||
// The region that should be used for signing requests.
|
||||
SigningRegion string
|
||||
|
||||
// The service name that should be used for signing requests.
|
||||
SigningName string
|
||||
|
||||
// The signing method that should be used for signing requests.
|
||||
SigningMethod string
|
||||
}
|
||||
|
||||
// So that the Error interface type can be included as an anonymous field
|
||||
// in the requestError struct and not conflict with the error.Error() method.
|
||||
type awsError awserr.Error
|
||||
|
||||
// A EndpointNotFoundError is returned when in StrictMatching mode, and the
|
||||
// endpoint for the service and region cannot be found in any of the partitions.
|
||||
type EndpointNotFoundError struct {
|
||||
awsError
|
||||
Partition string
|
||||
Service string
|
||||
Region string
|
||||
}
|
||||
|
||||
//// NewEndpointNotFoundError builds and returns NewEndpointNotFoundError.
|
||||
//func NewEndpointNotFoundError(p, s, r string) EndpointNotFoundError {
|
||||
// return EndpointNotFoundError{
|
||||
// awsError: awserr.New("EndpointNotFoundError", "unable to find endpoint", nil),
|
||||
// Partition: p,
|
||||
// Service: s,
|
||||
// Region: r,
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//// Error returns string representation of the error.
|
||||
//func (e EndpointNotFoundError) Error() string {
|
||||
// extra := fmt.Sprintf("partition: %q, service: %q, region: %q",
|
||||
// e.Partition, e.Service, e.Region)
|
||||
// return awserr.SprintError(e.Code(), e.Message(), extra, e.OrigErr())
|
||||
//}
|
||||
//
|
||||
//// String returns the string representation of the error.
|
||||
//func (e EndpointNotFoundError) String() string {
|
||||
// return e.Error()
|
||||
//}
|
||||
|
||||
// A UnknownServiceError is returned when the service does not resolve to an
|
||||
// endpoint. Includes a list of all known services for the partition. Returned
|
||||
// when a partition does not support the service.
|
||||
type UnknownServiceError struct {
|
||||
awsError
|
||||
Partition string
|
||||
Service string
|
||||
Known []string
|
||||
}
|
||||
|
||||
// NewUnknownServiceError builds and returns UnknownServiceError.
|
||||
func NewUnknownServiceError(p, s string, known []string) UnknownServiceError {
|
||||
return UnknownServiceError{
|
||||
awsError: awserr.New("UnknownServiceError",
|
||||
"could not resolve endpoint for unknown service", nil),
|
||||
Partition: p,
|
||||
Service: s,
|
||||
Known: known,
|
||||
}
|
||||
}
|
||||
|
||||
// String returns the string representation of the error.
|
||||
func (e UnknownServiceError) Error() string {
|
||||
extra := fmt.Sprintf("partition: %q, service: %q",
|
||||
e.Partition, e.Service)
|
||||
if len(e.Known) > 0 {
|
||||
extra += fmt.Sprintf(", known: %v", e.Known)
|
||||
}
|
||||
return awserr.SprintError(e.Code(), e.Message(), extra, e.OrigErr())
|
||||
}
|
||||
|
||||
// String returns the string representation of the error.
|
||||
func (e UnknownServiceError) String() string {
|
||||
return e.Error()
|
||||
}
|
||||
|
||||
// A UnknownEndpointError is returned when in StrictMatching mode and the
|
||||
// service is valid, but the region does not resolve to an endpoint. Includes
|
||||
// a list of all known endpoints for the service.
|
||||
type UnknownEndpointError struct {
|
||||
awsError
|
||||
Partition string
|
||||
Service string
|
||||
Region string
|
||||
Known []string
|
||||
}
|
||||
|
||||
// NewUnknownEndpointError builds and returns UnknownEndpointError.
|
||||
func NewUnknownEndpointError(p, s, r string, known []string) UnknownEndpointError {
|
||||
return UnknownEndpointError{
|
||||
awsError: awserr.New("UnknownEndpointError",
|
||||
"could not resolve endpoint", nil),
|
||||
Partition: p,
|
||||
Service: s,
|
||||
Region: r,
|
||||
Known: known,
|
||||
}
|
||||
}
|
||||
|
||||
// String returns the string representation of the error.
|
||||
func (e UnknownEndpointError) Error() string {
|
||||
extra := fmt.Sprintf("partition: %q, service: %q, region: %q",
|
||||
e.Partition, e.Service, e.Region)
|
||||
if len(e.Known) > 0 {
|
||||
extra += fmt.Sprintf(", known: %v", e.Known)
|
||||
}
|
||||
return awserr.SprintError(e.Code(), e.Message(), extra, e.OrigErr())
|
||||
}
|
||||
|
||||
// String returns the string representation of the error.
|
||||
func (e UnknownEndpointError) String() string {
|
||||
return e.Error()
|
||||
}
|
303
vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go
generated
vendored
Normal file
303
vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go
generated
vendored
Normal file
@ -0,0 +1,303 @@
|
||||
package endpoints
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type partitions []partition
|
||||
|
||||
func (ps partitions) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) {
|
||||
var opt Options
|
||||
opt.Set(opts...)
|
||||
|
||||
for i := 0; i < len(ps); i++ {
|
||||
if !ps[i].canResolveEndpoint(service, region, opt.StrictMatching) {
|
||||
continue
|
||||
}
|
||||
|
||||
return ps[i].EndpointFor(service, region, opts...)
|
||||
}
|
||||
|
||||
// If loose matching fallback to first partition format to use
|
||||
// when resolving the endpoint.
|
||||
if !opt.StrictMatching && len(ps) > 0 {
|
||||
return ps[0].EndpointFor(service, region, opts...)
|
||||
}
|
||||
|
||||
return ResolvedEndpoint{}, NewUnknownEndpointError("all partitions", service, region, []string{})
|
||||
}
|
||||
|
||||
// Partitions satisfies the EnumPartitions interface and returns a list
|
||||
// of Partitions representing each partition represented in the SDK's
|
||||
// endpoints model.
|
||||
func (ps partitions) Partitions() []Partition {
|
||||
parts := make([]Partition, 0, len(ps))
|
||||
for i := 0; i < len(ps); i++ {
|
||||
parts = append(parts, ps[i].Partition())
|
||||
}
|
||||
|
||||
return parts
|
||||
}
|
||||
|
||||
type partition struct {
|
||||
ID string `json:"partition"`
|
||||
Name string `json:"partitionName"`
|
||||
DNSSuffix string `json:"dnsSuffix"`
|
||||
RegionRegex regionRegex `json:"regionRegex"`
|
||||
Defaults endpoint `json:"defaults"`
|
||||
Regions regions `json:"regions"`
|
||||
Services services `json:"services"`
|
||||
}
|
||||
|
||||
func (p partition) Partition() Partition {
|
||||
return Partition{
|
||||
id: p.ID,
|
||||
p: &p,
|
||||
}
|
||||
}
|
||||
|
||||
func (p partition) canResolveEndpoint(service, region string, strictMatch bool) bool {
|
||||
s, hasService := p.Services[service]
|
||||
_, hasEndpoint := s.Endpoints[region]
|
||||
|
||||
if hasEndpoint && hasService {
|
||||
return true
|
||||
}
|
||||
|
||||
if strictMatch {
|
||||
return false
|
||||
}
|
||||
|
||||
return p.RegionRegex.MatchString(region)
|
||||
}
|
||||
|
||||
func (p partition) EndpointFor(service, region string, opts ...func(*Options)) (resolved ResolvedEndpoint, err error) {
|
||||
var opt Options
|
||||
opt.Set(opts...)
|
||||
|
||||
s, hasService := p.Services[service]
|
||||
if !(hasService || opt.ResolveUnknownService) {
|
||||
// Only return error if the resolver will not fallback to creating
|
||||
// endpoint based on service endpoint ID passed in.
|
||||
return resolved, NewUnknownServiceError(p.ID, service, serviceList(p.Services))
|
||||
}
|
||||
|
||||
e, hasEndpoint := s.endpointForRegion(region)
|
||||
if !hasEndpoint && opt.StrictMatching {
|
||||
return resolved, NewUnknownEndpointError(p.ID, service, region, endpointList(s.Endpoints))
|
||||
}
|
||||
|
||||
defs := []endpoint{p.Defaults, s.Defaults}
|
||||
return e.resolve(service, region, p.DNSSuffix, defs, opt), nil
|
||||
}
|
||||
|
||||
func serviceList(ss services) []string {
|
||||
list := make([]string, 0, len(ss))
|
||||
for k := range ss {
|
||||
list = append(list, k)
|
||||
}
|
||||
return list
|
||||
}
|
||||
func endpointList(es endpoints) []string {
|
||||
list := make([]string, 0, len(es))
|
||||
for k := range es {
|
||||
list = append(list, k)
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
type regionRegex struct {
|
||||
*regexp.Regexp
|
||||
}
|
||||
|
||||
func (rr *regionRegex) UnmarshalJSON(b []byte) (err error) {
|
||||
// Strip leading and trailing quotes
|
||||
regex, err := strconv.Unquote(string(b))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to strip quotes from regex, %v", err)
|
||||
}
|
||||
|
||||
rr.Regexp, err = regexp.Compile(regex)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to unmarshal region regex, %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type regions map[string]region
|
||||
|
||||
type region struct {
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type services map[string]service
|
||||
|
||||
type service struct {
|
||||
PartitionEndpoint string `json:"partitionEndpoint"`
|
||||
IsRegionalized boxedBool `json:"isRegionalized,omitempty"`
|
||||
Defaults endpoint `json:"defaults"`
|
||||
Endpoints endpoints `json:"endpoints"`
|
||||
}
|
||||
|
||||
func (s *service) endpointForRegion(region string) (endpoint, bool) {
|
||||
if s.IsRegionalized == boxedFalse {
|
||||
return s.Endpoints[s.PartitionEndpoint], region == s.PartitionEndpoint
|
||||
}
|
||||
|
||||
if e, ok := s.Endpoints[region]; ok {
|
||||
return e, true
|
||||
}
|
||||
|
||||
// Unable to find any matching endpoint, return
|
||||
// blank that will be used for generic endpoint creation.
|
||||
return endpoint{}, false
|
||||
}
|
||||
|
||||
type endpoints map[string]endpoint
|
||||
|
||||
type endpoint struct {
|
||||
Hostname string `json:"hostname"`
|
||||
Protocols []string `json:"protocols"`
|
||||
CredentialScope credentialScope `json:"credentialScope"`
|
||||
|
||||
// Custom fields not modeled
|
||||
HasDualStack boxedBool `json:"-"`
|
||||
DualStackHostname string `json:"-"`
|
||||
|
||||
// Signature Version not used
|
||||
SignatureVersions []string `json:"signatureVersions"`
|
||||
|
||||
// SSLCommonName not used.
|
||||
SSLCommonName string `json:"sslCommonName"`
|
||||
}
|
||||
|
||||
const (
|
||||
defaultProtocol = "https"
|
||||
defaultSigner = "v4"
|
||||
)
|
||||
|
||||
var (
|
||||
protocolPriority = []string{"https", "http"}
|
||||
signerPriority = []string{"v4", "v2"}
|
||||
)
|
||||
|
||||
func getByPriority(s []string, p []string, def string) string {
|
||||
if len(s) == 0 {
|
||||
return def
|
||||
}
|
||||
|
||||
for i := 0; i < len(p); i++ {
|
||||
for j := 0; j < len(s); j++ {
|
||||
if s[j] == p[i] {
|
||||
return s[j]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return s[0]
|
||||
}
|
||||
|
||||
func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint {
|
||||
var merged endpoint
|
||||
for _, def := range defs {
|
||||
merged.mergeIn(def)
|
||||
}
|
||||
merged.mergeIn(e)
|
||||
e = merged
|
||||
|
||||
hostname := e.Hostname
|
||||
|
||||
// Offset the hostname for dualstack if enabled
|
||||
if opts.UseDualStack && e.HasDualStack == boxedTrue {
|
||||
hostname = e.DualStackHostname
|
||||
}
|
||||
|
||||
u := strings.Replace(hostname, "{service}", service, 1)
|
||||
u = strings.Replace(u, "{region}", region, 1)
|
||||
u = strings.Replace(u, "{dnsSuffix}", dnsSuffix, 1)
|
||||
|
||||
scheme := getEndpointScheme(e.Protocols, opts.DisableSSL)
|
||||
u = fmt.Sprintf("%s://%s", scheme, u)
|
||||
|
||||
signingRegion := e.CredentialScope.Region
|
||||
if len(signingRegion) == 0 {
|
||||
signingRegion = region
|
||||
}
|
||||
signingName := e.CredentialScope.Service
|
||||
if len(signingName) == 0 {
|
||||
signingName = service
|
||||
}
|
||||
|
||||
return ResolvedEndpoint{
|
||||
URL: u,
|
||||
SigningRegion: signingRegion,
|
||||
SigningName: signingName,
|
||||
SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner),
|
||||
}
|
||||
}
|
||||
|
||||
func getEndpointScheme(protocols []string, disableSSL bool) string {
|
||||
if disableSSL {
|
||||
return "http"
|
||||
}
|
||||
|
||||
return getByPriority(protocols, protocolPriority, defaultProtocol)
|
||||
}
|
||||
|
||||
func (e *endpoint) mergeIn(other endpoint) {
|
||||
if len(other.Hostname) > 0 {
|
||||
e.Hostname = other.Hostname
|
||||
}
|
||||
if len(other.Protocols) > 0 {
|
||||
e.Protocols = other.Protocols
|
||||
}
|
||||
if len(other.SignatureVersions) > 0 {
|
||||
e.SignatureVersions = other.SignatureVersions
|
||||
}
|
||||
if len(other.CredentialScope.Region) > 0 {
|
||||
e.CredentialScope.Region = other.CredentialScope.Region
|
||||
}
|
||||
if len(other.CredentialScope.Service) > 0 {
|
||||
e.CredentialScope.Service = other.CredentialScope.Service
|
||||
}
|
||||
if len(other.SSLCommonName) > 0 {
|
||||
e.SSLCommonName = other.SSLCommonName
|
||||
}
|
||||
if other.HasDualStack != boxedBoolUnset {
|
||||
e.HasDualStack = other.HasDualStack
|
||||
}
|
||||
if len(other.DualStackHostname) > 0 {
|
||||
e.DualStackHostname = other.DualStackHostname
|
||||
}
|
||||
}
|
||||
|
||||
type credentialScope struct {
|
||||
Region string `json:"region"`
|
||||
Service string `json:"service"`
|
||||
}
|
||||
|
||||
type boxedBool int
|
||||
|
||||
func (b *boxedBool) UnmarshalJSON(buf []byte) error {
|
||||
v, err := strconv.ParseBool(string(buf))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if v {
|
||||
*b = boxedTrue
|
||||
} else {
|
||||
*b = boxedFalse
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const (
|
||||
boxedBoolUnset boxedBool = iota
|
||||
boxedFalse
|
||||
boxedTrue
|
||||
)
|
334
vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go
generated
vendored
Normal file
334
vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go
generated
vendored
Normal file
@ -0,0 +1,334 @@
|
||||
// +build codegen
|
||||
|
||||
package endpoints
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"reflect"
|
||||
"strings"
|
||||
"text/template"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
// A CodeGenOptions are the options for code generating the endpoints into
|
||||
// Go code from the endpoints model definition.
|
||||
type CodeGenOptions struct {
|
||||
// Options for how the model will be decoded.
|
||||
DecodeModelOptions DecodeModelOptions
|
||||
}
|
||||
|
||||
// Set combines all of the option functions together
|
||||
func (d *CodeGenOptions) Set(optFns ...func(*CodeGenOptions)) {
|
||||
for _, fn := range optFns {
|
||||
fn(d)
|
||||
}
|
||||
}
|
||||
|
||||
// CodeGenModel given a endpoints model file will decode it and attempt to
|
||||
// generate Go code from the model definition. Error will be returned if
|
||||
// the code is unable to be generated, or decoded.
|
||||
func CodeGenModel(modelFile io.Reader, outFile io.Writer, optFns ...func(*CodeGenOptions)) error {
|
||||
var opts CodeGenOptions
|
||||
opts.Set(optFns...)
|
||||
|
||||
resolver, err := DecodeModel(modelFile, func(d *DecodeModelOptions) {
|
||||
*d = opts.DecodeModelOptions
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tmpl := template.Must(template.New("tmpl").Funcs(funcMap).Parse(v3Tmpl))
|
||||
if err := tmpl.ExecuteTemplate(outFile, "defaults", resolver); err != nil {
|
||||
return fmt.Errorf("failed to execute template, %v", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func toSymbol(v string) string {
|
||||
out := []rune{}
|
||||
for _, c := range strings.Title(v) {
|
||||
if !(unicode.IsNumber(c) || unicode.IsLetter(c)) {
|
||||
continue
|
||||
}
|
||||
|
||||
out = append(out, c)
|
||||
}
|
||||
|
||||
return string(out)
|
||||
}
|
||||
|
||||
func quoteString(v string) string {
|
||||
return fmt.Sprintf("%q", v)
|
||||
}
|
||||
|
||||
func regionConstName(p, r string) string {
|
||||
return toSymbol(p) + toSymbol(r)
|
||||
}
|
||||
|
||||
func partitionGetter(id string) string {
|
||||
return fmt.Sprintf("%sPartition", toSymbol(id))
|
||||
}
|
||||
|
||||
func partitionVarName(id string) string {
|
||||
return fmt.Sprintf("%sPartition", strings.ToLower(toSymbol(id)))
|
||||
}
|
||||
|
||||
func listPartitionNames(ps partitions) string {
|
||||
names := []string{}
|
||||
switch len(ps) {
|
||||
case 1:
|
||||
return ps[0].Name
|
||||
case 2:
|
||||
return fmt.Sprintf("%s and %s", ps[0].Name, ps[1].Name)
|
||||
default:
|
||||
for i, p := range ps {
|
||||
if i == len(ps)-1 {
|
||||
names = append(names, "and "+p.Name)
|
||||
} else {
|
||||
names = append(names, p.Name)
|
||||
}
|
||||
}
|
||||
return strings.Join(names, ", ")
|
||||
}
|
||||
}
|
||||
|
||||
func boxedBoolIfSet(msg string, v boxedBool) string {
|
||||
switch v {
|
||||
case boxedTrue:
|
||||
return fmt.Sprintf(msg, "boxedTrue")
|
||||
case boxedFalse:
|
||||
return fmt.Sprintf(msg, "boxedFalse")
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
func stringIfSet(msg, v string) string {
|
||||
if len(v) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
return fmt.Sprintf(msg, v)
|
||||
}
|
||||
|
||||
func stringSliceIfSet(msg string, vs []string) string {
|
||||
if len(vs) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
names := []string{}
|
||||
for _, v := range vs {
|
||||
names = append(names, `"`+v+`"`)
|
||||
}
|
||||
|
||||
return fmt.Sprintf(msg, strings.Join(names, ","))
|
||||
}
|
||||
|
||||
func endpointIsSet(v endpoint) bool {
|
||||
return !reflect.DeepEqual(v, endpoint{})
|
||||
}
|
||||
|
||||
func serviceSet(ps partitions) map[string]struct{} {
|
||||
set := map[string]struct{}{}
|
||||
for _, p := range ps {
|
||||
for id := range p.Services {
|
||||
set[id] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
return set
|
||||
}
|
||||
|
||||
var funcMap = template.FuncMap{
|
||||
"ToSymbol": toSymbol,
|
||||
"QuoteString": quoteString,
|
||||
"RegionConst": regionConstName,
|
||||
"PartitionGetter": partitionGetter,
|
||||
"PartitionVarName": partitionVarName,
|
||||
"ListPartitionNames": listPartitionNames,
|
||||
"BoxedBoolIfSet": boxedBoolIfSet,
|
||||
"StringIfSet": stringIfSet,
|
||||
"StringSliceIfSet": stringSliceIfSet,
|
||||
"EndpointIsSet": endpointIsSet,
|
||||
"ServicesSet": serviceSet,
|
||||
}
|
||||
|
||||
const v3Tmpl = `
|
||||
{{ define "defaults" -}}
|
||||
// Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT.
|
||||
|
||||
package endpoints
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
{{ template "partition consts" . }}
|
||||
|
||||
{{ range $_, $partition := . }}
|
||||
{{ template "partition region consts" $partition }}
|
||||
{{ end }}
|
||||
|
||||
{{ template "service consts" . }}
|
||||
|
||||
{{ template "endpoint resolvers" . }}
|
||||
{{- end }}
|
||||
|
||||
{{ define "partition consts" }}
|
||||
// Partition identifiers
|
||||
const (
|
||||
{{ range $_, $p := . -}}
|
||||
{{ ToSymbol $p.ID }}PartitionID = {{ QuoteString $p.ID }} // {{ $p.Name }} partition.
|
||||
{{ end -}}
|
||||
)
|
||||
{{- end }}
|
||||
|
||||
{{ define "partition region consts" }}
|
||||
// {{ .Name }} partition's regions.
|
||||
const (
|
||||
{{ range $id, $region := .Regions -}}
|
||||
{{ ToSymbol $id }}RegionID = {{ QuoteString $id }} // {{ $region.Description }}.
|
||||
{{ end -}}
|
||||
)
|
||||
{{- end }}
|
||||
|
||||
{{ define "service consts" }}
|
||||
// Service identifiers
|
||||
const (
|
||||
{{ $serviceSet := ServicesSet . -}}
|
||||
{{ range $id, $_ := $serviceSet -}}
|
||||
{{ ToSymbol $id }}ServiceID = {{ QuoteString $id }} // {{ ToSymbol $id }}.
|
||||
{{ end -}}
|
||||
)
|
||||
{{- end }}
|
||||
|
||||
{{ define "endpoint resolvers" }}
|
||||
// DefaultResolver returns an Endpoint resolver that will be able
|
||||
// to resolve endpoints for: {{ ListPartitionNames . }}.
|
||||
//
|
||||
// Casting the return value of this func to a EnumPartitions will
|
||||
// allow you to get a list of the partitions in the order the endpoints
|
||||
// will be resolved in.
|
||||
//
|
||||
// resolver := endpoints.DefaultResolver()
|
||||
// partitions := resolver.(endpoints.EnumPartitions).Partitions()
|
||||
// for _, p := range partitions {
|
||||
// // ... inspect partitions
|
||||
// }
|
||||
func DefaultResolver() Resolver {
|
||||
return defaultPartitions
|
||||
}
|
||||
|
||||
var defaultPartitions = partitions{
|
||||
{{ range $_, $partition := . -}}
|
||||
{{ PartitionVarName $partition.ID }},
|
||||
{{ end }}
|
||||
}
|
||||
|
||||
{{ range $_, $partition := . -}}
|
||||
{{ $name := PartitionGetter $partition.ID -}}
|
||||
// {{ $name }} returns the Resolver for {{ $partition.Name }}.
|
||||
func {{ $name }}() Partition {
|
||||
return {{ PartitionVarName $partition.ID }}.Partition()
|
||||
}
|
||||
var {{ PartitionVarName $partition.ID }} = {{ template "gocode Partition" $partition }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "default partitions" }}
|
||||
func DefaultPartitions() []Partition {
|
||||
return []partition{
|
||||
{{ range $_, $partition := . -}}
|
||||
// {{ ToSymbol $partition.ID}}Partition(),
|
||||
{{ end }}
|
||||
}
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
{{ define "gocode Partition" -}}
|
||||
partition{
|
||||
{{ StringIfSet "ID: %q,\n" .ID -}}
|
||||
{{ StringIfSet "Name: %q,\n" .Name -}}
|
||||
{{ StringIfSet "DNSSuffix: %q,\n" .DNSSuffix -}}
|
||||
RegionRegex: {{ template "gocode RegionRegex" .RegionRegex }},
|
||||
{{ if EndpointIsSet .Defaults -}}
|
||||
Defaults: {{ template "gocode Endpoint" .Defaults }},
|
||||
{{- end }}
|
||||
Regions: {{ template "gocode Regions" .Regions }},
|
||||
Services: {{ template "gocode Services" .Services }},
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{ define "gocode RegionRegex" -}}
|
||||
regionRegex{
|
||||
Regexp: func() *regexp.Regexp{
|
||||
reg, _ := regexp.Compile({{ QuoteString .Regexp.String }})
|
||||
return reg
|
||||
}(),
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{ define "gocode Regions" -}}
|
||||
regions{
|
||||
{{ range $id, $region := . -}}
|
||||
"{{ $id }}": {{ template "gocode Region" $region }},
|
||||
{{ end -}}
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{ define "gocode Region" -}}
|
||||
region{
|
||||
{{ StringIfSet "Description: %q,\n" .Description -}}
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{ define "gocode Services" -}}
|
||||
services{
|
||||
{{ range $id, $service := . -}}
|
||||
"{{ $id }}": {{ template "gocode Service" $service }},
|
||||
{{ end }}
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{ define "gocode Service" -}}
|
||||
service{
|
||||
{{ StringIfSet "PartitionEndpoint: %q,\n" .PartitionEndpoint -}}
|
||||
{{ BoxedBoolIfSet "IsRegionalized: %s,\n" .IsRegionalized -}}
|
||||
{{ if EndpointIsSet .Defaults -}}
|
||||
Defaults: {{ template "gocode Endpoint" .Defaults -}},
|
||||
{{- end }}
|
||||
{{ if .Endpoints -}}
|
||||
Endpoints: {{ template "gocode Endpoints" .Endpoints }},
|
||||
{{- end }}
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{ define "gocode Endpoints" -}}
|
||||
endpoints{
|
||||
{{ range $id, $endpoint := . -}}
|
||||
"{{ $id }}": {{ template "gocode Endpoint" $endpoint }},
|
||||
{{ end }}
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{ define "gocode Endpoint" -}}
|
||||
endpoint{
|
||||
{{ StringIfSet "Hostname: %q,\n" .Hostname -}}
|
||||
{{ StringIfSet "SSLCommonName: %q,\n" .SSLCommonName -}}
|
||||
{{ StringSliceIfSet "Protocols: []string{%s},\n" .Protocols -}}
|
||||
{{ StringSliceIfSet "SignatureVersions: []string{%s},\n" .SignatureVersions -}}
|
||||
{{ if or .CredentialScope.Region .CredentialScope.Service -}}
|
||||
CredentialScope: credentialScope{
|
||||
{{ StringIfSet "Region: %q,\n" .CredentialScope.Region -}}
|
||||
{{ StringIfSet "Service: %q,\n" .CredentialScope.Service -}}
|
||||
},
|
||||
{{- end }}
|
||||
{{ BoxedBoolIfSet "HasDualStack: %s,\n" .HasDualStack -}}
|
||||
{{ StringIfSet "DualStackHostname: %q,\n" .DualStackHostname -}}
|
||||
|
||||
}
|
||||
{{- end }}
|
||||
`
|
11
vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go
generated
vendored
Normal file
11
vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
package aws
|
||||
|
||||
// JSONValue is a representation of a grab bag type that will be marshaled
|
||||
// into a json string. This type can be used just like any other map.
|
||||
//
|
||||
// Example:
|
||||
// values := JSONValue{
|
||||
// "Foo": "Bar",
|
||||
// }
|
||||
// values["Baz"] = "Qux"
|
||||
type JSONValue map[string]interface{}
|
66
vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go
generated
vendored
66
vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go
generated
vendored
@ -18,6 +18,7 @@ type Handlers struct {
|
||||
UnmarshalError HandlerList
|
||||
Retry HandlerList
|
||||
AfterRetry HandlerList
|
||||
Complete HandlerList
|
||||
}
|
||||
|
||||
// Copy returns of this handler's lists.
|
||||
@ -33,6 +34,7 @@ func (h *Handlers) Copy() Handlers {
|
||||
UnmarshalMeta: h.UnmarshalMeta.copy(),
|
||||
Retry: h.Retry.copy(),
|
||||
AfterRetry: h.AfterRetry.copy(),
|
||||
Complete: h.Complete.copy(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,6 +50,7 @@ func (h *Handlers) Clear() {
|
||||
h.ValidateResponse.Clear()
|
||||
h.Retry.Clear()
|
||||
h.AfterRetry.Clear()
|
||||
h.Complete.Clear()
|
||||
}
|
||||
|
||||
// A HandlerListRunItem represents an entry in the HandlerList which
|
||||
@ -85,13 +88,17 @@ func (l *HandlerList) copy() HandlerList {
|
||||
n := HandlerList{
|
||||
AfterEachFn: l.AfterEachFn,
|
||||
}
|
||||
n.list = append([]NamedHandler{}, l.list...)
|
||||
if len(l.list) == 0 {
|
||||
return n
|
||||
}
|
||||
|
||||
n.list = append(make([]NamedHandler, 0, len(l.list)), l.list...)
|
||||
return n
|
||||
}
|
||||
|
||||
// Clear clears the handler list.
|
||||
func (l *HandlerList) Clear() {
|
||||
l.list = []NamedHandler{}
|
||||
l.list = l.list[0:0]
|
||||
}
|
||||
|
||||
// Len returns the number of handlers in the list.
|
||||
@ -101,33 +108,54 @@ func (l *HandlerList) Len() int {
|
||||
|
||||
// PushBack pushes handler f to the back of the handler list.
|
||||
func (l *HandlerList) PushBack(f func(*Request)) {
|
||||
l.list = append(l.list, NamedHandler{"__anonymous", f})
|
||||
}
|
||||
|
||||
// PushFront pushes handler f to the front of the handler list.
|
||||
func (l *HandlerList) PushFront(f func(*Request)) {
|
||||
l.list = append([]NamedHandler{{"__anonymous", f}}, l.list...)
|
||||
l.PushBackNamed(NamedHandler{"__anonymous", f})
|
||||
}
|
||||
|
||||
// PushBackNamed pushes named handler f to the back of the handler list.
|
||||
func (l *HandlerList) PushBackNamed(n NamedHandler) {
|
||||
if cap(l.list) == 0 {
|
||||
l.list = make([]NamedHandler, 0, 5)
|
||||
}
|
||||
l.list = append(l.list, n)
|
||||
}
|
||||
|
||||
// PushFront pushes handler f to the front of the handler list.
|
||||
func (l *HandlerList) PushFront(f func(*Request)) {
|
||||
l.PushFrontNamed(NamedHandler{"__anonymous", f})
|
||||
}
|
||||
|
||||
// PushFrontNamed pushes named handler f to the front of the handler list.
|
||||
func (l *HandlerList) PushFrontNamed(n NamedHandler) {
|
||||
l.list = append([]NamedHandler{n}, l.list...)
|
||||
if cap(l.list) == len(l.list) {
|
||||
// Allocating new list required
|
||||
l.list = append([]NamedHandler{n}, l.list...)
|
||||
} else {
|
||||
// Enough room to prepend into list.
|
||||
l.list = append(l.list, NamedHandler{})
|
||||
copy(l.list[1:], l.list)
|
||||
l.list[0] = n
|
||||
}
|
||||
}
|
||||
|
||||
// Remove removes a NamedHandler n
|
||||
func (l *HandlerList) Remove(n NamedHandler) {
|
||||
newlist := []NamedHandler{}
|
||||
for _, m := range l.list {
|
||||
if m.Name != n.Name {
|
||||
newlist = append(newlist, m)
|
||||
l.RemoveByName(n.Name)
|
||||
}
|
||||
|
||||
// RemoveByName removes a NamedHandler by name.
|
||||
func (l *HandlerList) RemoveByName(name string) {
|
||||
for i := 0; i < len(l.list); i++ {
|
||||
m := l.list[i]
|
||||
if m.Name == name {
|
||||
// Shift array preventing creating new arrays
|
||||
copy(l.list[i:], l.list[i+1:])
|
||||
l.list[len(l.list)-1] = NamedHandler{}
|
||||
l.list = l.list[:len(l.list)-1]
|
||||
|
||||
// decrement list so next check to length is correct
|
||||
i--
|
||||
}
|
||||
}
|
||||
l.list = newlist
|
||||
}
|
||||
|
||||
// Run executes all handlers in the list with a given request object.
|
||||
@ -163,6 +191,16 @@ func HandlerListStopOnError(item HandlerListRunItem) bool {
|
||||
return item.Request.Error == nil
|
||||
}
|
||||
|
||||
// WithAppendUserAgent will add a string to the user agent prefixed with a
|
||||
// single white space.
|
||||
func WithAppendUserAgent(s string) Option {
|
||||
return func(r *Request) {
|
||||
r.Handlers.Build.PushBack(func(r2 *Request) {
|
||||
AddToUserAgent(r, s)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request
|
||||
// header. If the extra parameters are provided they will be added as metadata to the
|
||||
// name/version pair resulting in the following format.
|
||||
|
249
vendor/github.com/aws/aws-sdk-go/aws/request/request.go
generated
vendored
249
vendor/github.com/aws/aws-sdk-go/aws/request/request.go
generated
vendored
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
@ -15,6 +16,21 @@ import (
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
)
|
||||
|
||||
const (
|
||||
// ErrCodeSerialization is the serialization error code that is received
|
||||
// during protocol unmarshaling.
|
||||
ErrCodeSerialization = "SerializationError"
|
||||
|
||||
// ErrCodeResponseTimeout is the connection timeout error that is recieved
|
||||
// during body reads.
|
||||
ErrCodeResponseTimeout = "ResponseTimeout"
|
||||
|
||||
// CanceledErrorCode is the error code that will be returned by an
|
||||
// API request that was canceled. Requests given a aws.Context may
|
||||
// return this error when canceled.
|
||||
CanceledErrorCode = "RequestCanceled"
|
||||
)
|
||||
|
||||
// A Request is the service request to be made.
|
||||
type Request struct {
|
||||
Config aws.Config
|
||||
@ -40,12 +56,14 @@ type Request struct {
|
||||
SignedHeaderVals http.Header
|
||||
LastSignedAt time.Time
|
||||
|
||||
context aws.Context
|
||||
|
||||
built bool
|
||||
|
||||
// Need to persist an intermideant body betweend the input Body and HTTP
|
||||
// Need to persist an intermediate body between the input Body and HTTP
|
||||
// request body because the HTTP Client's transport can maintain a reference
|
||||
// to the HTTP request's body after the client has returned. This value is
|
||||
// safe to use concurrently and rewraps the input Body for each HTTP request.
|
||||
// safe to use concurrently and wrap the input Body for each HTTP request.
|
||||
safeBody *offsetReader
|
||||
}
|
||||
|
||||
@ -55,14 +73,8 @@ type Operation struct {
|
||||
HTTPMethod string
|
||||
HTTPPath string
|
||||
*Paginator
|
||||
}
|
||||
|
||||
// Paginator keeps track of pagination configuration for an API operation.
|
||||
type Paginator struct {
|
||||
InputTokens []string
|
||||
OutputTokens []string
|
||||
LimitToken string
|
||||
TruncationToken string
|
||||
BeforePresignFn func(r *Request) error
|
||||
}
|
||||
|
||||
// New returns a new Request pointer for the service API
|
||||
@ -108,6 +120,94 @@ func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers,
|
||||
return r
|
||||
}
|
||||
|
||||
// A Option is a functional option that can augment or modify a request when
|
||||
// using a WithContext API operation method.
|
||||
type Option func(*Request)
|
||||
|
||||
// WithGetResponseHeader builds a request Option which will retrieve a single
|
||||
// header value from the HTTP Response. If there are multiple values for the
|
||||
// header key use WithGetResponseHeaders instead to access the http.Header
|
||||
// map directly. The passed in val pointer must be non-nil.
|
||||
//
|
||||
// This Option can be used multiple times with a single API operation.
|
||||
//
|
||||
// var id2, versionID string
|
||||
// svc.PutObjectWithContext(ctx, params,
|
||||
// request.WithGetResponseHeader("x-amz-id-2", &id2),
|
||||
// request.WithGetResponseHeader("x-amz-version-id", &versionID),
|
||||
// )
|
||||
func WithGetResponseHeader(key string, val *string) Option {
|
||||
return func(r *Request) {
|
||||
r.Handlers.Complete.PushBack(func(req *Request) {
|
||||
*val = req.HTTPResponse.Header.Get(key)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// WithGetResponseHeaders builds a request Option which will retrieve the
|
||||
// headers from the HTTP response and assign them to the passed in headers
|
||||
// variable. The passed in headers pointer must be non-nil.
|
||||
//
|
||||
// var headers http.Header
|
||||
// svc.PutObjectWithContext(ctx, params, request.WithGetResponseHeaders(&headers))
|
||||
func WithGetResponseHeaders(headers *http.Header) Option {
|
||||
return func(r *Request) {
|
||||
r.Handlers.Complete.PushBack(func(req *Request) {
|
||||
*headers = req.HTTPResponse.Header
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// WithLogLevel is a request option that will set the request to use a specific
|
||||
// log level when the request is made.
|
||||
//
|
||||
// svc.PutObjectWithContext(ctx, params, request.WithLogLevel(aws.LogDebugWithHTTPBody)
|
||||
func WithLogLevel(l aws.LogLevelType) Option {
|
||||
return func(r *Request) {
|
||||
r.Config.LogLevel = aws.LogLevel(l)
|
||||
}
|
||||
}
|
||||
|
||||
// ApplyOptions will apply each option to the request calling them in the order
|
||||
// the were provided.
|
||||
func (r *Request) ApplyOptions(opts ...Option) {
|
||||
for _, opt := range opts {
|
||||
opt(r)
|
||||
}
|
||||
}
|
||||
|
||||
// Context will always returns a non-nil context. If Request does not have a
|
||||
// context aws.BackgroundContext will be returned.
|
||||
func (r *Request) Context() aws.Context {
|
||||
if r.context != nil {
|
||||
return r.context
|
||||
}
|
||||
return aws.BackgroundContext()
|
||||
}
|
||||
|
||||
// SetContext adds a Context to the current request that can be used to cancel
|
||||
// a in-flight request. The Context value must not be nil, or this method will
|
||||
// panic.
|
||||
//
|
||||
// Unlike http.Request.WithContext, SetContext does not return a copy of the
|
||||
// Request. It is not safe to use use a single Request value for multiple
|
||||
// requests. A new Request should be created for each API operation request.
|
||||
//
|
||||
// Go 1.6 and below:
|
||||
// The http.Request's Cancel field will be set to the Done() value of
|
||||
// the context. This will overwrite the Cancel field's value.
|
||||
//
|
||||
// Go 1.7 and above:
|
||||
// The http.Request.WithContext will be used to set the context on the underlying
|
||||
// http.Request. This will create a shallow copy of the http.Request. The SDK
|
||||
// may create sub contexts in the future for nested requests such as retries.
|
||||
func (r *Request) SetContext(ctx aws.Context) {
|
||||
if ctx == nil {
|
||||
panic("context cannot be nil")
|
||||
}
|
||||
setRequestContext(r, ctx)
|
||||
}
|
||||
|
||||
// WillRetry returns if the request's can be retried.
|
||||
func (r *Request) WillRetry() bool {
|
||||
return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries()
|
||||
@ -149,6 +249,15 @@ func (r *Request) SetReaderBody(reader io.ReadSeeker) {
|
||||
func (r *Request) Presign(expireTime time.Duration) (string, error) {
|
||||
r.ExpireTime = expireTime
|
||||
r.NotHoist = false
|
||||
|
||||
if r.Operation.BeforePresignFn != nil {
|
||||
r = r.copy()
|
||||
err := r.Operation.BeforePresignFn(r)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
r.Sign()
|
||||
if r.Error != nil {
|
||||
return "", r.Error
|
||||
@ -234,7 +343,82 @@ func (r *Request) ResetBody() {
|
||||
}
|
||||
|
||||
r.safeBody = newOffsetReader(r.Body, r.BodyStart)
|
||||
r.HTTPRequest.Body = r.safeBody
|
||||
|
||||
// Go 1.8 tightened and clarified the rules code needs to use when building
|
||||
// requests with the http package. Go 1.8 removed the automatic detection
|
||||
// of if the Request.Body was empty, or actually had bytes in it. The SDK
|
||||
// always sets the Request.Body even if it is empty and should not actually
|
||||
// be sent. This is incorrect.
|
||||
//
|
||||
// Go 1.8 did add a http.NoBody value that the SDK can use to tell the http
|
||||
// client that the request really should be sent without a body. The
|
||||
// Request.Body cannot be set to nil, which is preferable, because the
|
||||
// field is exported and could introduce nil pointer dereferences for users
|
||||
// of the SDK if they used that field.
|
||||
//
|
||||
// Related golang/go#18257
|
||||
l, err := computeBodyLength(r.Body)
|
||||
if err != nil {
|
||||
r.Error = awserr.New(ErrCodeSerialization, "failed to compute request body size", err)
|
||||
return
|
||||
}
|
||||
|
||||
if l == 0 {
|
||||
r.HTTPRequest.Body = noBodyReader
|
||||
} else if l > 0 {
|
||||
r.HTTPRequest.Body = r.safeBody
|
||||
} else {
|
||||
// Hack to prevent sending bodies for methods where the body
|
||||
// should be ignored by the server. Sending bodies on these
|
||||
// methods without an associated ContentLength will cause the
|
||||
// request to socket timeout because the server does not handle
|
||||
// Transfer-Encoding: chunked bodies for these methods.
|
||||
//
|
||||
// This would only happen if a aws.ReaderSeekerCloser was used with
|
||||
// a io.Reader that was not also an io.Seeker.
|
||||
switch r.Operation.HTTPMethod {
|
||||
case "GET", "HEAD", "DELETE":
|
||||
r.HTTPRequest.Body = noBodyReader
|
||||
default:
|
||||
r.HTTPRequest.Body = r.safeBody
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Attempts to compute the length of the body of the reader using the
|
||||
// io.Seeker interface. If the value is not seekable because of being
|
||||
// a ReaderSeekerCloser without an unerlying Seeker -1 will be returned.
|
||||
// If no error occurs the length of the body will be returned.
|
||||
func computeBodyLength(r io.ReadSeeker) (int64, error) {
|
||||
seekable := true
|
||||
// Determine if the seeker is actually seekable. ReaderSeekerCloser
|
||||
// hides the fact that a io.Readers might not actually be seekable.
|
||||
switch v := r.(type) {
|
||||
case aws.ReaderSeekerCloser:
|
||||
seekable = v.IsSeeker()
|
||||
case *aws.ReaderSeekerCloser:
|
||||
seekable = v.IsSeeker()
|
||||
}
|
||||
if !seekable {
|
||||
return -1, nil
|
||||
}
|
||||
|
||||
curOffset, err := r.Seek(0, 1)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
endOffset, err := r.Seek(0, 2)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
_, err = r.Seek(curOffset, 0)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return endOffset - curOffset, nil
|
||||
}
|
||||
|
||||
// GetBody will return an io.ReadSeeker of the Request's underlying
|
||||
@ -257,6 +441,12 @@ func (r *Request) GetBody() io.ReadSeeker {
|
||||
//
|
||||
// Send will not close the request.Request's body.
|
||||
func (r *Request) Send() error {
|
||||
defer func() {
|
||||
// Regardless of success or failure of the request trigger the Complete
|
||||
// request handlers.
|
||||
r.Handlers.Complete.Run(r)
|
||||
}()
|
||||
|
||||
for {
|
||||
if aws.BoolValue(r.Retryable) {
|
||||
if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
|
||||
@ -286,7 +476,7 @@ func (r *Request) Send() error {
|
||||
|
||||
r.Handlers.Send.Run(r)
|
||||
if r.Error != nil {
|
||||
if strings.Contains(r.Error.Error(), "net/http: request canceled") {
|
||||
if !shouldRetryCancel(r) {
|
||||
return r.Error
|
||||
}
|
||||
|
||||
@ -334,6 +524,17 @@ func (r *Request) Send() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// copy will copy a request which will allow for local manipulation of the
|
||||
// request.
|
||||
func (r *Request) copy() *Request {
|
||||
req := &Request{}
|
||||
*req = *r
|
||||
req.Handlers = r.Handlers.Copy()
|
||||
op := *r.Operation
|
||||
req.Operation = &op
|
||||
return req
|
||||
}
|
||||
|
||||
// AddToUserAgent adds the string to the end of the request's current user agent.
|
||||
func AddToUserAgent(r *Request, s string) {
|
||||
curUA := r.HTTPRequest.Header.Get("User-Agent")
|
||||
@ -342,3 +543,29 @@ func AddToUserAgent(r *Request, s string) {
|
||||
}
|
||||
r.HTTPRequest.Header.Set("User-Agent", s)
|
||||
}
|
||||
|
||||
func shouldRetryCancel(r *Request) bool {
|
||||
awsErr, ok := r.Error.(awserr.Error)
|
||||
timeoutErr := false
|
||||
errStr := r.Error.Error()
|
||||
if ok {
|
||||
if awsErr.Code() == CanceledErrorCode {
|
||||
return false
|
||||
}
|
||||
err := awsErr.OrigErr()
|
||||
netErr, netOK := err.(net.Error)
|
||||
timeoutErr = netOK && netErr.Temporary()
|
||||
if urlErr, ok := err.(*url.Error); !timeoutErr && ok {
|
||||
errStr = urlErr.Err.Error()
|
||||
}
|
||||
}
|
||||
|
||||
// There can be two types of canceled errors here.
|
||||
// The first being a net.Error and the other being an error.
|
||||
// If the request was timed out, we want to continue the retry
|
||||
// process. Otherwise, return the canceled error.
|
||||
return timeoutErr ||
|
||||
(errStr != "net/http: request canceled" &&
|
||||
errStr != "net/http: request canceled while waiting for connection")
|
||||
|
||||
}
|
||||
|
21
vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go
generated
vendored
Normal file
21
vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// +build !go1.8
|
||||
|
||||
package request
|
||||
|
||||
import "io"
|
||||
|
||||
// NoBody is an io.ReadCloser with no bytes. Read always returns EOF
|
||||
// and Close always returns nil. It can be used in an outgoing client
|
||||
// request to explicitly signal that a request has zero bytes.
|
||||
// An alternative, however, is to simply set Request.Body to nil.
|
||||
//
|
||||
// Copy of Go 1.8 NoBody type from net/http/http.go
|
||||
type noBody struct{}
|
||||
|
||||
func (noBody) Read([]byte) (int, error) { return 0, io.EOF }
|
||||
func (noBody) Close() error { return nil }
|
||||
func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil }
|
||||
|
||||
// Is an empty reader that will trigger the Go HTTP client to not include
|
||||
// and body in the HTTP request.
|
||||
var noBodyReader = noBody{}
|
9
vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go
generated
vendored
Normal file
9
vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// +build go1.8
|
||||
|
||||
package request
|
||||
|
||||
import "net/http"
|
||||
|
||||
// Is a http.NoBody reader instructing Go HTTP client to not include
|
||||
// and body in the HTTP request.
|
||||
var noBodyReader = http.NoBody
|
14
vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go
generated
vendored
Normal file
14
vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
// +build go1.7
|
||||
|
||||
package request
|
||||
|
||||
import "github.com/aws/aws-sdk-go/aws"
|
||||
|
||||
// setContext updates the Request to use the passed in context for cancellation.
|
||||
// Context will also be used for request retry delay.
|
||||
//
|
||||
// Creates shallow copy of the http.Request with the WithContext method.
|
||||
func setRequestContext(r *Request, ctx aws.Context) {
|
||||
r.context = ctx
|
||||
r.HTTPRequest = r.HTTPRequest.WithContext(ctx)
|
||||
}
|
14
vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go
generated
vendored
Normal file
14
vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
// +build !go1.7
|
||||
|
||||
package request
|
||||
|
||||
import "github.com/aws/aws-sdk-go/aws"
|
||||
|
||||
// setContext updates the Request to use the passed in context for cancellation.
|
||||
// Context will also be used for request retry delay.
|
||||
//
|
||||
// Creates shallow copy of the http.Request with the WithContext method.
|
||||
func setRequestContext(r *Request, ctx aws.Context) {
|
||||
r.context = ctx
|
||||
r.HTTPRequest.Cancel = ctx.Done()
|
||||
}
|
154
vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
generated
vendored
154
vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
generated
vendored
@ -2,29 +2,125 @@ package request
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awsutil"
|
||||
)
|
||||
|
||||
//type Paginater interface {
|
||||
// HasNextPage() bool
|
||||
// NextPage() *Request
|
||||
// EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error
|
||||
//}
|
||||
// A Pagination provides paginating of SDK API operations which are paginatable.
|
||||
// Generally you should not use this type directly, but use the "Pages" API
|
||||
// operations method to automatically perform pagination for you. Such as,
|
||||
// "S3.ListObjectsPages", and "S3.ListObjectsPagesWithContext" methods.
|
||||
//
|
||||
// Pagination differs from a Paginator type in that pagination is the type that
|
||||
// does the pagination between API operations, and Paginator defines the
|
||||
// configuration that will be used per page request.
|
||||
//
|
||||
// cont := true
|
||||
// for p.Next() && cont {
|
||||
// data := p.Page().(*s3.ListObjectsOutput)
|
||||
// // process the page's data
|
||||
// }
|
||||
// return p.Err()
|
||||
//
|
||||
// See service client API operation Pages methods for examples how the SDK will
|
||||
// use the Pagination type.
|
||||
type Pagination struct {
|
||||
// Function to return a Request value for each pagination request.
|
||||
// Any configuration or handlers that need to be applied to the request
|
||||
// prior to getting the next page should be done here before the request
|
||||
// returned.
|
||||
//
|
||||
// NewRequest should always be built from the same API operations. It is
|
||||
// undefined if different API operations are returned on subsequent calls.
|
||||
NewRequest func() (*Request, error)
|
||||
|
||||
// HasNextPage returns true if this request has more pages of data available.
|
||||
func (r *Request) HasNextPage() bool {
|
||||
return len(r.nextPageTokens()) > 0
|
||||
started bool
|
||||
nextTokens []interface{}
|
||||
|
||||
err error
|
||||
curPage interface{}
|
||||
}
|
||||
|
||||
// nextPageTokens returns the tokens to use when asking for the next page of
|
||||
// data.
|
||||
// HasNextPage will return true if Pagination is able to determine that the API
|
||||
// operation has additional pages. False will be returned if there are no more
|
||||
// pages remaining.
|
||||
//
|
||||
// Will always return true if Next has not been called yet.
|
||||
func (p *Pagination) HasNextPage() bool {
|
||||
return !(p.started && len(p.nextTokens) == 0)
|
||||
}
|
||||
|
||||
// Err returns the error Pagination encountered when retrieving the next page.
|
||||
func (p *Pagination) Err() error {
|
||||
return p.err
|
||||
}
|
||||
|
||||
// Page returns the current page. Page should only be called after a successful
|
||||
// call to Next. It is undefined what Page will return if Page is called after
|
||||
// Next returns false.
|
||||
func (p *Pagination) Page() interface{} {
|
||||
return p.curPage
|
||||
}
|
||||
|
||||
// Next will attempt to retrieve the next page for the API operation. When a page
|
||||
// is retrieved true will be returned. If the page cannot be retrieved, or there
|
||||
// are no more pages false will be returned.
|
||||
//
|
||||
// Use the Page method to retrieve the current page data. The data will need
|
||||
// to be cast to the API operation's output type.
|
||||
//
|
||||
// Use the Err method to determine if an error occurred if Page returns false.
|
||||
func (p *Pagination) Next() bool {
|
||||
if !p.HasNextPage() {
|
||||
return false
|
||||
}
|
||||
|
||||
req, err := p.NewRequest()
|
||||
if err != nil {
|
||||
p.err = err
|
||||
return false
|
||||
}
|
||||
|
||||
if p.started {
|
||||
for i, intok := range req.Operation.InputTokens {
|
||||
awsutil.SetValueAtPath(req.Params, intok, p.nextTokens[i])
|
||||
}
|
||||
}
|
||||
p.started = true
|
||||
|
||||
err = req.Send()
|
||||
if err != nil {
|
||||
p.err = err
|
||||
return false
|
||||
}
|
||||
|
||||
p.nextTokens = req.nextPageTokens()
|
||||
p.curPage = req.Data
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// A Paginator is the configuration data that defines how an API operation
|
||||
// should be paginated. This type is used by the API service models to define
|
||||
// the generated pagination config for service APIs.
|
||||
//
|
||||
// The Pagination type is what provides iterating between pages of an API. It
|
||||
// is only used to store the token metadata the SDK should use for performing
|
||||
// pagination.
|
||||
type Paginator struct {
|
||||
InputTokens []string
|
||||
OutputTokens []string
|
||||
LimitToken string
|
||||
TruncationToken string
|
||||
}
|
||||
|
||||
// nextPageTokens returns the tokens to use when asking for the next page of data.
|
||||
func (r *Request) nextPageTokens() []interface{} {
|
||||
if r.Operation.Paginator == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if r.Operation.TruncationToken != "" {
|
||||
tr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken)
|
||||
if len(tr) == 0 {
|
||||
@ -61,9 +157,40 @@ func (r *Request) nextPageTokens() []interface{} {
|
||||
return tokens
|
||||
}
|
||||
|
||||
// Ensure a deprecated item is only logged once instead of each time its used.
|
||||
func logDeprecatedf(logger aws.Logger, flag *int32, msg string) {
|
||||
if logger == nil {
|
||||
return
|
||||
}
|
||||
if atomic.CompareAndSwapInt32(flag, 0, 1) {
|
||||
logger.Log(msg)
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
logDeprecatedHasNextPage int32
|
||||
logDeprecatedNextPage int32
|
||||
logDeprecatedEachPage int32
|
||||
)
|
||||
|
||||
// HasNextPage returns true if this request has more pages of data available.
|
||||
//
|
||||
// Deprecated Use Pagination type for configurable pagination of API operations
|
||||
func (r *Request) HasNextPage() bool {
|
||||
logDeprecatedf(r.Config.Logger, &logDeprecatedHasNextPage,
|
||||
"Request.HasNextPage deprecated. Use Pagination type for configurable pagination of API operations")
|
||||
|
||||
return len(r.nextPageTokens()) > 0
|
||||
}
|
||||
|
||||
// NextPage returns a new Request that can be executed to return the next
|
||||
// page of result data. Call .Send() on this request to execute it.
|
||||
//
|
||||
// Deprecated Use Pagination type for configurable pagination of API operations
|
||||
func (r *Request) NextPage() *Request {
|
||||
logDeprecatedf(r.Config.Logger, &logDeprecatedNextPage,
|
||||
"Request.NextPage deprecated. Use Pagination type for configurable pagination of API operations")
|
||||
|
||||
tokens := r.nextPageTokens()
|
||||
if len(tokens) == 0 {
|
||||
return nil
|
||||
@ -90,7 +217,12 @@ func (r *Request) NextPage() *Request {
|
||||
// as the structure "T". The lastPage value represents whether the page is
|
||||
// the last page of data or not. The return value of this function should
|
||||
// return true to keep iterating or false to stop.
|
||||
//
|
||||
// Deprecated Use Pagination type for configurable pagination of API operations
|
||||
func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error {
|
||||
logDeprecatedf(r.Config.Logger, &logDeprecatedEachPage,
|
||||
"Request.EachPage deprecated. Use Pagination type for configurable pagination of API operations")
|
||||
|
||||
for page := r; page != nil; page = page.NextPage() {
|
||||
if err := page.Send(); err != nil {
|
||||
return err
|
||||
|
32
vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go
generated
vendored
32
vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go
generated
vendored
@ -1,6 +1,9 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
@ -26,8 +29,10 @@ func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config {
|
||||
// retryableCodes is a collection of service response codes which are retry-able
|
||||
// without any further action.
|
||||
var retryableCodes = map[string]struct{}{
|
||||
"RequestError": {},
|
||||
"RequestTimeout": {},
|
||||
"RequestError": {},
|
||||
"RequestTimeout": {},
|
||||
ErrCodeResponseTimeout: {},
|
||||
"RequestTimeoutException": {}, // Glacier's flavor of RequestTimeout
|
||||
}
|
||||
|
||||
var throttleCodes = map[string]struct{}{
|
||||
@ -38,6 +43,7 @@ var throttleCodes = map[string]struct{}{
|
||||
"RequestThrottled": {},
|
||||
"LimitExceededException": {}, // Deleting 10+ DynamoDb tables at once
|
||||
"TooManyRequestsException": {}, // Lambda functions
|
||||
"PriorRequestNotComplete": {}, // Route53
|
||||
}
|
||||
|
||||
// credsExpiredCodes is a collection of error codes which signify the credentials
|
||||
@ -67,12 +73,32 @@ func isCodeExpiredCreds(code string) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
func isSerializationErrorRetryable(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
return isCodeRetryable(aerr.Code())
|
||||
}
|
||||
|
||||
if opErr, ok := err.(*net.OpError); ok {
|
||||
if sysErr, ok := opErr.Err.(*os.SyscallError); ok {
|
||||
return sysErr.Err == syscall.ECONNRESET
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// IsErrorRetryable returns whether the error is retryable, based on its Code.
|
||||
// Returns false if the request has no Error set.
|
||||
func (r *Request) IsErrorRetryable() bool {
|
||||
if r.Error != nil {
|
||||
if err, ok := r.Error.(awserr.Error); ok {
|
||||
if err, ok := r.Error.(awserr.Error); ok && err.Code() != ErrCodeSerialization {
|
||||
return isCodeRetryable(err.Code())
|
||||
} else if ok {
|
||||
return isSerializationErrorRetryable(err.OrigErr())
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
94
vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go
generated
vendored
Normal file
94
vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
)
|
||||
|
||||
var timeoutErr = awserr.New(
|
||||
ErrCodeResponseTimeout,
|
||||
"read on body has reached the timeout limit",
|
||||
nil,
|
||||
)
|
||||
|
||||
type readResult struct {
|
||||
n int
|
||||
err error
|
||||
}
|
||||
|
||||
// timeoutReadCloser will handle body reads that take too long.
|
||||
// We will return a ErrReadTimeout error if a timeout occurs.
|
||||
type timeoutReadCloser struct {
|
||||
reader io.ReadCloser
|
||||
duration time.Duration
|
||||
}
|
||||
|
||||
// Read will spin off a goroutine to call the reader's Read method. We will
|
||||
// select on the timer's channel or the read's channel. Whoever completes first
|
||||
// will be returned.
|
||||
func (r *timeoutReadCloser) Read(b []byte) (int, error) {
|
||||
timer := time.NewTimer(r.duration)
|
||||
c := make(chan readResult, 1)
|
||||
|
||||
go func() {
|
||||
n, err := r.reader.Read(b)
|
||||
timer.Stop()
|
||||
c <- readResult{n: n, err: err}
|
||||
}()
|
||||
|
||||
select {
|
||||
case data := <-c:
|
||||
return data.n, data.err
|
||||
case <-timer.C:
|
||||
return 0, timeoutErr
|
||||
}
|
||||
}
|
||||
|
||||
func (r *timeoutReadCloser) Close() error {
|
||||
return r.reader.Close()
|
||||
}
|
||||
|
||||
const (
|
||||
// HandlerResponseTimeout is what we use to signify the name of the
|
||||
// response timeout handler.
|
||||
HandlerResponseTimeout = "ResponseTimeoutHandler"
|
||||
)
|
||||
|
||||
// adaptToResponseTimeoutError is a handler that will replace any top level error
|
||||
// to a ErrCodeResponseTimeout, if its child is that.
|
||||
func adaptToResponseTimeoutError(req *Request) {
|
||||
if err, ok := req.Error.(awserr.Error); ok {
|
||||
aerr, ok := err.OrigErr().(awserr.Error)
|
||||
if ok && aerr.Code() == ErrCodeResponseTimeout {
|
||||
req.Error = aerr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithResponseReadTimeout is a request option that will wrap the body in a timeout read closer.
|
||||
// This will allow for per read timeouts. If a timeout occurred, we will return the
|
||||
// ErrCodeResponseTimeout.
|
||||
//
|
||||
// svc.PutObjectWithContext(ctx, params, request.WithTimeoutReadCloser(30 * time.Second)
|
||||
func WithResponseReadTimeout(duration time.Duration) Option {
|
||||
return func(r *Request) {
|
||||
|
||||
var timeoutHandler = NamedHandler{
|
||||
HandlerResponseTimeout,
|
||||
func(req *Request) {
|
||||
req.HTTPResponse.Body = &timeoutReadCloser{
|
||||
reader: req.HTTPResponse.Body,
|
||||
duration: duration,
|
||||
}
|
||||
}}
|
||||
|
||||
// remove the handler so we are not stomping over any new durations.
|
||||
r.Handlers.Send.RemoveByName(HandlerResponseTimeout)
|
||||
r.Handlers.Send.PushBackNamed(timeoutHandler)
|
||||
|
||||
r.Handlers.Unmarshal.PushBack(adaptToResponseTimeoutError)
|
||||
r.Handlers.UnmarshalError.PushBack(adaptToResponseTimeoutError)
|
||||
}
|
||||
}
|
293
vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go
generated
vendored
Normal file
293
vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go
generated
vendored
Normal file
@ -0,0 +1,293 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/awsutil"
|
||||
)
|
||||
|
||||
// WaiterResourceNotReadyErrorCode is the error code returned by a waiter when
|
||||
// the waiter's max attempts have been exhausted.
|
||||
const WaiterResourceNotReadyErrorCode = "ResourceNotReady"
|
||||
|
||||
// A WaiterOption is a function that will update the Waiter value's fields to
|
||||
// configure the waiter.
|
||||
type WaiterOption func(*Waiter)
|
||||
|
||||
// WithWaiterMaxAttempts returns the maximum number of times the waiter should
|
||||
// attempt to check the resource for the target state.
|
||||
func WithWaiterMaxAttempts(max int) WaiterOption {
|
||||
return func(w *Waiter) {
|
||||
w.MaxAttempts = max
|
||||
}
|
||||
}
|
||||
|
||||
// WaiterDelay will return a delay the waiter should pause between attempts to
|
||||
// check the resource state. The passed in attempt is the number of times the
|
||||
// Waiter has checked the resource state.
|
||||
//
|
||||
// Attempt is the number of attempts the Waiter has made checking the resource
|
||||
// state.
|
||||
type WaiterDelay func(attempt int) time.Duration
|
||||
|
||||
// ConstantWaiterDelay returns a WaiterDelay that will always return a constant
|
||||
// delay the waiter should use between attempts. It ignores the number of
|
||||
// attempts made.
|
||||
func ConstantWaiterDelay(delay time.Duration) WaiterDelay {
|
||||
return func(attempt int) time.Duration {
|
||||
return delay
|
||||
}
|
||||
}
|
||||
|
||||
// WithWaiterDelay will set the Waiter to use the WaiterDelay passed in.
|
||||
func WithWaiterDelay(delayer WaiterDelay) WaiterOption {
|
||||
return func(w *Waiter) {
|
||||
w.Delay = delayer
|
||||
}
|
||||
}
|
||||
|
||||
// WithWaiterLogger returns a waiter option to set the logger a waiter
|
||||
// should use to log warnings and errors to.
|
||||
func WithWaiterLogger(logger aws.Logger) WaiterOption {
|
||||
return func(w *Waiter) {
|
||||
w.Logger = logger
|
||||
}
|
||||
}
|
||||
|
||||
// WithWaiterRequestOptions returns a waiter option setting the request
|
||||
// options for each request the waiter makes. Appends to waiter's request
|
||||
// options already set.
|
||||
func WithWaiterRequestOptions(opts ...Option) WaiterOption {
|
||||
return func(w *Waiter) {
|
||||
w.RequestOptions = append(w.RequestOptions, opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// A Waiter provides the functionality to performing blocking call which will
|
||||
// wait for an resource state to be satisfied a service.
|
||||
//
|
||||
// This type should not be used directly. The API operations provided in the
|
||||
// service packages prefixed with "WaitUntil" should be used instead.
|
||||
type Waiter struct {
|
||||
Name string
|
||||
Acceptors []WaiterAcceptor
|
||||
Logger aws.Logger
|
||||
|
||||
MaxAttempts int
|
||||
Delay WaiterDelay
|
||||
|
||||
RequestOptions []Option
|
||||
NewRequest func([]Option) (*Request, error)
|
||||
}
|
||||
|
||||
// ApplyOptions updates the waiter with the list of waiter options provided.
|
||||
func (w *Waiter) ApplyOptions(opts ...WaiterOption) {
|
||||
for _, fn := range opts {
|
||||
fn(w)
|
||||
}
|
||||
}
|
||||
|
||||
// WaiterState are states the waiter uses based on WaiterAcceptor definitions
|
||||
// to identify if the resource state the waiter is waiting on has occurred.
|
||||
type WaiterState int
|
||||
|
||||
// String returns the string representation of the waiter state.
|
||||
func (s WaiterState) String() string {
|
||||
switch s {
|
||||
case SuccessWaiterState:
|
||||
return "success"
|
||||
case FailureWaiterState:
|
||||
return "failure"
|
||||
case RetryWaiterState:
|
||||
return "retry"
|
||||
default:
|
||||
return "unknown waiter state"
|
||||
}
|
||||
}
|
||||
|
||||
// States the waiter acceptors will use to identify target resource states.
|
||||
const (
|
||||
SuccessWaiterState WaiterState = iota // waiter successful
|
||||
FailureWaiterState // waiter failed
|
||||
RetryWaiterState // waiter needs to be retried
|
||||
)
|
||||
|
||||
// WaiterMatchMode is the mode that the waiter will use to match the WaiterAcceptor
|
||||
// definition's Expected attribute.
|
||||
type WaiterMatchMode int
|
||||
|
||||
// Modes the waiter will use when inspecting API response to identify target
|
||||
// resource states.
|
||||
const (
|
||||
PathAllWaiterMatch WaiterMatchMode = iota // match on all paths
|
||||
PathWaiterMatch // match on specific path
|
||||
PathAnyWaiterMatch // match on any path
|
||||
PathListWaiterMatch // match on list of paths
|
||||
StatusWaiterMatch // match on status code
|
||||
ErrorWaiterMatch // match on error
|
||||
)
|
||||
|
||||
// String returns the string representation of the waiter match mode.
|
||||
func (m WaiterMatchMode) String() string {
|
||||
switch m {
|
||||
case PathAllWaiterMatch:
|
||||
return "pathAll"
|
||||
case PathWaiterMatch:
|
||||
return "path"
|
||||
case PathAnyWaiterMatch:
|
||||
return "pathAny"
|
||||
case PathListWaiterMatch:
|
||||
return "pathList"
|
||||
case StatusWaiterMatch:
|
||||
return "status"
|
||||
case ErrorWaiterMatch:
|
||||
return "error"
|
||||
default:
|
||||
return "unknown waiter match mode"
|
||||
}
|
||||
}
|
||||
|
||||
// WaitWithContext will make requests for the API operation using NewRequest to
|
||||
// build API requests. The request's response will be compared against the
|
||||
// Waiter's Acceptors to determine the successful state of the resource the
|
||||
// waiter is inspecting.
|
||||
//
|
||||
// The passed in context must not be nil. If it is nil a panic will occur. The
|
||||
// Context will be used to cancel the waiter's pending requests and retry delays.
|
||||
// Use aws.BackgroundContext if no context is available.
|
||||
//
|
||||
// The waiter will continue until the target state defined by the Acceptors,
|
||||
// or the max attempts expires.
|
||||
//
|
||||
// Will return the WaiterResourceNotReadyErrorCode error code if the waiter's
|
||||
// retryer ShouldRetry returns false. This normally will happen when the max
|
||||
// wait attempts expires.
|
||||
func (w Waiter) WaitWithContext(ctx aws.Context) error {
|
||||
|
||||
for attempt := 1; ; attempt++ {
|
||||
req, err := w.NewRequest(w.RequestOptions)
|
||||
if err != nil {
|
||||
waiterLogf(w.Logger, "unable to create request %v", err)
|
||||
return err
|
||||
}
|
||||
req.Handlers.Build.PushBack(MakeAddToUserAgentFreeFormHandler("Waiter"))
|
||||
err = req.Send()
|
||||
|
||||
// See if any of the acceptors match the request's response, or error
|
||||
for _, a := range w.Acceptors {
|
||||
var matched bool
|
||||
matched, err = a.match(w.Name, w.Logger, req, err)
|
||||
if err != nil {
|
||||
// Error occurred during current waiter call
|
||||
return err
|
||||
} else if matched {
|
||||
// Match was found can stop here and return
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// The Waiter should only check the resource state MaxAttempts times
|
||||
// This is here instead of in the for loop above to prevent delaying
|
||||
// unnecessary when the waiter will not retry.
|
||||
if attempt == w.MaxAttempts {
|
||||
break
|
||||
}
|
||||
|
||||
// Delay to wait before inspecting the resource again
|
||||
delay := w.Delay(attempt)
|
||||
if sleepFn := req.Config.SleepDelay; sleepFn != nil {
|
||||
// Support SleepDelay for backwards compatibility and testing
|
||||
sleepFn(delay)
|
||||
} else if err := aws.SleepWithContext(ctx, delay); err != nil {
|
||||
return awserr.New(CanceledErrorCode, "waiter context canceled", err)
|
||||
}
|
||||
}
|
||||
|
||||
return awserr.New(WaiterResourceNotReadyErrorCode, "exceeded wait attempts", nil)
|
||||
}
|
||||
|
||||
// A WaiterAcceptor provides the information needed to wait for an API operation
|
||||
// to complete.
|
||||
type WaiterAcceptor struct {
|
||||
State WaiterState
|
||||
Matcher WaiterMatchMode
|
||||
Argument string
|
||||
Expected interface{}
|
||||
}
|
||||
|
||||
// match returns if the acceptor found a match with the passed in request
|
||||
// or error. True is returned if the acceptor made a match, error is returned
|
||||
// if there was an error attempting to perform the match.
|
||||
func (a *WaiterAcceptor) match(name string, l aws.Logger, req *Request, err error) (bool, error) {
|
||||
result := false
|
||||
var vals []interface{}
|
||||
|
||||
switch a.Matcher {
|
||||
case PathAllWaiterMatch, PathWaiterMatch:
|
||||
// Require all matches to be equal for result to match
|
||||
vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
|
||||
if len(vals) == 0 {
|
||||
break
|
||||
}
|
||||
result = true
|
||||
for _, val := range vals {
|
||||
if !awsutil.DeepEqual(val, a.Expected) {
|
||||
result = false
|
||||
break
|
||||
}
|
||||
}
|
||||
case PathAnyWaiterMatch:
|
||||
// Only a single match needs to equal for the result to match
|
||||
vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
|
||||
for _, val := range vals {
|
||||
if awsutil.DeepEqual(val, a.Expected) {
|
||||
result = true
|
||||
break
|
||||
}
|
||||
}
|
||||
case PathListWaiterMatch:
|
||||
// ignored matcher
|
||||
case StatusWaiterMatch:
|
||||
s := a.Expected.(int)
|
||||
result = s == req.HTTPResponse.StatusCode
|
||||
case ErrorWaiterMatch:
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
result = aerr.Code() == a.Expected.(string)
|
||||
}
|
||||
default:
|
||||
waiterLogf(l, "WARNING: Waiter %s encountered unexpected matcher: %s",
|
||||
name, a.Matcher)
|
||||
}
|
||||
|
||||
if !result {
|
||||
// If there was no matching result found there is nothing more to do
|
||||
// for this response, retry the request.
|
||||
return false, nil
|
||||
}
|
||||
|
||||
switch a.State {
|
||||
case SuccessWaiterState:
|
||||
// waiter completed
|
||||
return true, nil
|
||||
case FailureWaiterState:
|
||||
// Waiter failure state triggered
|
||||
return false, awserr.New("ResourceNotReady",
|
||||
"failed waiting for successful resource state", err)
|
||||
case RetryWaiterState:
|
||||
// clear the error and retry the operation
|
||||
return false, nil
|
||||
default:
|
||||
waiterLogf(l, "WARNING: Waiter %s encountered unexpected state: %s",
|
||||
name, a.State)
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
|
||||
func waiterLogf(logger aws.Logger, msg string, args ...interface{}) {
|
||||
if logger != nil {
|
||||
logger.Log(fmt.Sprintf(msg, args...))
|
||||
}
|
||||
}
|
89
vendor/github.com/aws/aws-sdk-go/aws/session/doc.go
generated
vendored
89
vendor/github.com/aws/aws-sdk-go/aws/session/doc.go
generated
vendored
@ -45,16 +45,16 @@ region, and profile loaded from the environment and shared config automatically.
|
||||
Requires the AWS_PROFILE to be set, or "default" is used.
|
||||
|
||||
// Create Session
|
||||
sess, err := session.NewSession()
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
// Create a Session with a custom region
|
||||
sess, err := session.NewSession(&aws.Config{Region: aws.String("us-east-1")})
|
||||
sess := session.Must(session.NewSession(&aws.Config{
|
||||
Region: aws.String("us-east-1"),
|
||||
}))
|
||||
|
||||
// Create a S3 client instance from a session
|
||||
sess, err := session.NewSession()
|
||||
if err != nil {
|
||||
// Handle Session creation error
|
||||
}
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := s3.New(sess)
|
||||
|
||||
Create Session With Option Overrides
|
||||
@ -67,23 +67,25 @@ Use NewSessionWithOptions when you want to provide the config profile, or
|
||||
override the shared config state (AWS_SDK_LOAD_CONFIG).
|
||||
|
||||
// Equivalent to session.NewSession()
|
||||
sess, err := session.NewSessionWithOptions(session.Options{})
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
// Options
|
||||
}))
|
||||
|
||||
// Specify profile to load for the session's config
|
||||
sess, err := session.NewSessionWithOptions(session.Options{
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
Profile: "profile_name",
|
||||
})
|
||||
}))
|
||||
|
||||
// Specify profile for config and region for requests
|
||||
sess, err := session.NewSessionWithOptions(session.Options{
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
Config: aws.Config{Region: aws.String("us-east-1")},
|
||||
Profile: "profile_name",
|
||||
})
|
||||
}))
|
||||
|
||||
// Force enable Shared Config support
|
||||
sess, err := session.NewSessionWithOptions(session.Options{
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
SharedConfigState: SharedConfigEnable,
|
||||
})
|
||||
}))
|
||||
|
||||
Adding Handlers
|
||||
|
||||
@ -93,7 +95,8 @@ handler logs every request and its payload made by a service client:
|
||||
|
||||
// Create a session, and add additional handlers for all service
|
||||
// clients created with the Session to inherit. Adds logging handler.
|
||||
sess, err := session.NewSession()
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
sess.Handlers.Send.PushFront(func(r *request.Request) {
|
||||
// Log every request made and its payload
|
||||
logger.Println("Request: %s/%s, Payload: %s",
|
||||
@ -138,15 +141,14 @@ the other two fields are also provided.
|
||||
|
||||
Assume Role values allow you to configure the SDK to assume an IAM role using
|
||||
a set of credentials provided in a config file via the source_profile field.
|
||||
Both "role_arn" and "source_profile" are required. The SDK does not support
|
||||
assuming a role with MFA token Via the Session's constructor. You can use the
|
||||
stscreds.AssumeRoleProvider credentials provider to specify custom
|
||||
configuration and support for MFA.
|
||||
Both "role_arn" and "source_profile" are required. The SDK supports assuming
|
||||
a role with MFA token if the session option AssumeRoleTokenProvider
|
||||
is set.
|
||||
|
||||
role_arn = arn:aws:iam::<account_number>:role/<role_name>
|
||||
source_profile = profile_with_creds
|
||||
external_id = 1234
|
||||
mfa_serial = not supported!
|
||||
mfa_serial = <serial or mfa arn>
|
||||
role_session_name = session_name
|
||||
|
||||
Region is the region the SDK should use for looking up AWS service endpoints
|
||||
@ -154,6 +156,37 @@ and signing requests.
|
||||
|
||||
region = us-east-1
|
||||
|
||||
Assume Role with MFA token
|
||||
|
||||
To create a session with support for assuming an IAM role with MFA set the
|
||||
session option AssumeRoleTokenProvider to a function that will prompt for the
|
||||
MFA token code when the SDK assumes the role and refreshes the role's credentials.
|
||||
This allows you to configure the SDK via the shared config to assumea role
|
||||
with MFA tokens.
|
||||
|
||||
In order for the SDK to assume a role with MFA the SharedConfigState
|
||||
session option must be set to SharedConfigEnable, or AWS_SDK_LOAD_CONFIG
|
||||
environment variable set.
|
||||
|
||||
The shared configuration instructs the SDK to assume an IAM role with MFA
|
||||
when the mfa_serial configuration field is set in the shared config
|
||||
(~/.aws/config) or shared credentials (~/.aws/credentials) file.
|
||||
|
||||
If mfa_serial is set in the configuration, the SDK will assume the role, and
|
||||
the AssumeRoleTokenProvider session option is not set an an error will
|
||||
be returned when creating the session.
|
||||
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
AssumeRoleTokenProvider: stscreds.StdinTokenProvider,
|
||||
}))
|
||||
|
||||
// Create service client value configured for credentials
|
||||
// from assumed role.
|
||||
svc := s3.New(sess)
|
||||
|
||||
To setup assume role outside of a session see the stscrds.AssumeRoleProvider
|
||||
documentation.
|
||||
|
||||
Environment Variables
|
||||
|
||||
When a Session is created several environment variables can be set to adjust
|
||||
@ -218,6 +251,24 @@ $HOME/.aws/config on Linux/Unix based systems, and
|
||||
|
||||
AWS_CONFIG_FILE=$HOME/my_shared_config
|
||||
|
||||
Path to a custom Credentials Authority (CA) bundle PEM file that the SDK
|
||||
will use instead of the default system's root CA bundle. Use this only
|
||||
if you want to replace the CA bundle the SDK uses for TLS requests.
|
||||
|
||||
AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle
|
||||
|
||||
Enabling this option will attempt to merge the Transport into the SDK's HTTP
|
||||
client. If the client's Transport is not a http.Transport an error will be
|
||||
returned. If the Transport's TLS config is set this option will cause the SDK
|
||||
to overwrite the Transport's TLS config's RootCAs value. If the CA bundle file
|
||||
contains multiple certificates all of them will be loaded.
|
||||
|
||||
The Session option CustomCABundle is also available when creating sessions
|
||||
to also enable this feature. CustomCABundle session option field has priority
|
||||
over the AWS_CA_BUNDLE environment variable, and will be used if both are set.
|
||||
|
||||
Setting a custom HTTPClient in the aws.Config options will override this setting.
|
||||
To use this option and custom HTTP client, the HTTP client needs to be provided
|
||||
when creating the session. Not the service client.
|
||||
*/
|
||||
package session
|
||||
|
20
vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go
generated
vendored
20
vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go
generated
vendored
@ -75,6 +75,24 @@ type envConfig struct {
|
||||
//
|
||||
// AWS_CONFIG_FILE=$HOME/my_shared_config
|
||||
SharedConfigFile string
|
||||
|
||||
// Sets the path to a custom Credentials Authroity (CA) Bundle PEM file
|
||||
// that the SDK will use instead of the the system's root CA bundle.
|
||||
// Only use this if you want to configure the SDK to use a custom set
|
||||
// of CAs.
|
||||
//
|
||||
// Enabling this option will attempt to merge the Transport
|
||||
// into the SDK's HTTP client. If the client's Transport is
|
||||
// not a http.Transport an error will be returned. If the
|
||||
// Transport's TLS config is set this option will cause the
|
||||
// SDK to overwrite the Transport's TLS config's RootCAs value.
|
||||
//
|
||||
// Setting a custom HTTPClient in the aws.Config options will override this setting.
|
||||
// To use this option and custom HTTP client, the HTTP client needs to be provided
|
||||
// when creating the session. Not the service client.
|
||||
//
|
||||
// AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle
|
||||
CustomCABundle string
|
||||
}
|
||||
|
||||
var (
|
||||
@ -150,6 +168,8 @@ func envConfigLoad(enableSharedConfig bool) envConfig {
|
||||
cfg.SharedCredentialsFile = sharedCredentialsFilename()
|
||||
cfg.SharedConfigFile = sharedConfigFilename()
|
||||
|
||||
cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE")
|
||||
|
||||
return cfg
|
||||
}
|
||||
|
||||
|
267
vendor/github.com/aws/aws-sdk-go/aws/session/session.go
generated
vendored
267
vendor/github.com/aws/aws-sdk-go/aws/session/session.go
generated
vendored
@ -1,7 +1,13 @@
|
||||
package session
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
@ -10,8 +16,8 @@ import (
|
||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
|
||||
"github.com/aws/aws-sdk-go/aws/defaults"
|
||||
"github.com/aws/aws-sdk-go/aws/endpoints"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/private/endpoints"
|
||||
)
|
||||
|
||||
// A Session provides a central location to create service clients from and
|
||||
@ -34,17 +40,17 @@ type Session struct {
|
||||
// If the AWS_SDK_LOAD_CONFIG environment is set to a truthy value, the New
|
||||
// method could now encounter an error when loading the configuration. When
|
||||
// The environment variable is set, and an error occurs, New will return a
|
||||
// session that will fail all requests reporting the error that occured while
|
||||
// session that will fail all requests reporting the error that occurred while
|
||||
// loading the session. Use NewSession to get the error when creating the
|
||||
// session.
|
||||
//
|
||||
// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
|
||||
// the shared config file (~/.aws/config) will also be loaded, in addition to
|
||||
// the shared credentials file (~/.aws/config). Values set in both the
|
||||
// the shared credentials file (~/.aws/credentials). Values set in both the
|
||||
// shared config, and shared credentials will be taken from the shared
|
||||
// credentials file.
|
||||
//
|
||||
// Deprecated: Use NewSession functiions to create sessions instead. NewSession
|
||||
// Deprecated: Use NewSession functions to create sessions instead. NewSession
|
||||
// has the same functionality as New except an error can be returned when the
|
||||
// func is called instead of waiting to receive an error until a request is made.
|
||||
func New(cfgs ...*aws.Config) *Session {
|
||||
@ -52,14 +58,14 @@ func New(cfgs ...*aws.Config) *Session {
|
||||
envCfg := loadEnvConfig()
|
||||
|
||||
if envCfg.EnableSharedConfig {
|
||||
s, err := newSession(envCfg, cfgs...)
|
||||
s, err := newSession(Options{}, envCfg, cfgs...)
|
||||
if err != nil {
|
||||
// Old session.New expected all errors to be discovered when
|
||||
// a request is made, and would report the errors then. This
|
||||
// needs to be replicated if an error occurs while creating
|
||||
// the session.
|
||||
msg := "failed to create session with AWS_SDK_LOAD_CONFIG enabled. " +
|
||||
"Use session.NewSession to handle errors occuring during session creation."
|
||||
"Use session.NewSession to handle errors occurring during session creation."
|
||||
|
||||
// Session creation failed, need to report the error and prevent
|
||||
// any requests from succeeding.
|
||||
@ -73,7 +79,7 @@ func New(cfgs ...*aws.Config) *Session {
|
||||
return s
|
||||
}
|
||||
|
||||
return oldNewSession(cfgs...)
|
||||
return deprecatedNewSession(cfgs...)
|
||||
}
|
||||
|
||||
// NewSession returns a new Session created from SDK defaults, config files,
|
||||
@ -83,18 +89,19 @@ func New(cfgs ...*aws.Config) *Session {
|
||||
//
|
||||
// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
|
||||
// the shared config file (~/.aws/config) will also be loaded in addition to
|
||||
// the shared credentials file (~/.aws/config). Values set in both the
|
||||
// the shared credentials file (~/.aws/credentials). Values set in both the
|
||||
// shared config, and shared credentials will be taken from the shared
|
||||
// credentials file. Enabling the Shared Config will also allow the Session
|
||||
// to be built with retrieving credentials with AssumeRole set in the config.
|
||||
//
|
||||
// See the NewSessionWithOptions func for information on how to override or
|
||||
// control through code how the Session will be created. Such as specifing the
|
||||
// control through code how the Session will be created. Such as specifying the
|
||||
// config profile, and controlling if shared config is enabled or not.
|
||||
func NewSession(cfgs ...*aws.Config) (*Session, error) {
|
||||
envCfg := loadEnvConfig()
|
||||
opts := Options{}
|
||||
opts.Config.MergeIn(cfgs...)
|
||||
|
||||
return newSession(envCfg, cfgs...)
|
||||
return NewSessionWithOptions(opts)
|
||||
}
|
||||
|
||||
// SharedConfigState provides the ability to optionally override the state
|
||||
@ -124,7 +131,7 @@ type Options struct {
|
||||
// Provides config values for the SDK to use when creating service clients
|
||||
// and making API requests to services. Any value set in with this field
|
||||
// will override the associated value provided by the SDK defaults,
|
||||
// environment or config files where relevent.
|
||||
// environment or config files where relevant.
|
||||
//
|
||||
// If not set, configuration values from from SDK defaults, environment,
|
||||
// config will be used.
|
||||
@ -147,6 +154,41 @@ type Options struct {
|
||||
// will allow you to override the AWS_SDK_LOAD_CONFIG environment variable
|
||||
// and enable or disable the shared config functionality.
|
||||
SharedConfigState SharedConfigState
|
||||
|
||||
// When the SDK's shared config is configured to assume a role with MFA
|
||||
// this option is required in order to provide the mechanism that will
|
||||
// retrieve the MFA token. There is no default value for this field. If
|
||||
// it is not set an error will be returned when creating the session.
|
||||
//
|
||||
// This token provider will be called when ever the assumed role's
|
||||
// credentials need to be refreshed. Within the context of service clients
|
||||
// all sharing the same session the SDK will ensure calls to the token
|
||||
// provider are atomic. When sharing a token provider across multiple
|
||||
// sessions additional synchronization logic is needed to ensure the
|
||||
// token providers do not introduce race conditions. It is recommend to
|
||||
// share the session where possible.
|
||||
//
|
||||
// stscreds.StdinTokenProvider is a basic implementation that will prompt
|
||||
// from stdin for the MFA token code.
|
||||
//
|
||||
// This field is only used if the shared configuration is enabled, and
|
||||
// the config enables assume role wit MFA via the mfa_serial field.
|
||||
AssumeRoleTokenProvider func() (string, error)
|
||||
|
||||
// Reader for a custom Credentials Authority (CA) bundle in PEM format that
|
||||
// the SDK will use instead of the default system's root CA bundle. Use this
|
||||
// only if you want to replace the CA bundle the SDK uses for TLS requests.
|
||||
//
|
||||
// Enabling this option will attempt to merge the Transport into the SDK's HTTP
|
||||
// client. If the client's Transport is not a http.Transport an error will be
|
||||
// returned. If the Transport's TLS config is set this option will cause the SDK
|
||||
// to overwrite the Transport's TLS config's RootCAs value. If the CA
|
||||
// bundle reader contains multiple certificates all of them will be loaded.
|
||||
//
|
||||
// The Session option CustomCABundle is also available when creating sessions
|
||||
// to also enable this feature. CustomCABundle session option field has priority
|
||||
// over the AWS_CA_BUNDLE environment variable, and will be used if both are set.
|
||||
CustomCABundle io.Reader
|
||||
}
|
||||
|
||||
// NewSessionWithOptions returns a new Session created from SDK defaults, config files,
|
||||
@ -155,29 +197,29 @@ type Options struct {
|
||||
//
|
||||
// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
|
||||
// the shared config file (~/.aws/config) will also be loaded in addition to
|
||||
// the shared credentials file (~/.aws/config). Values set in both the
|
||||
// the shared credentials file (~/.aws/credentials). Values set in both the
|
||||
// shared config, and shared credentials will be taken from the shared
|
||||
// credentials file. Enabling the Shared Config will also allow the Session
|
||||
// to be built with retrieving credentials with AssumeRole set in the config.
|
||||
//
|
||||
// // Equivalent to session.New
|
||||
// sess, err := session.NewSessionWithOptions(session.Options{})
|
||||
// sess := session.Must(session.NewSessionWithOptions(session.Options{}))
|
||||
//
|
||||
// // Specify profile to load for the session's config
|
||||
// sess, err := session.NewSessionWithOptions(session.Options{
|
||||
// sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
// Profile: "profile_name",
|
||||
// })
|
||||
// }))
|
||||
//
|
||||
// // Specify profile for config and region for requests
|
||||
// sess, err := session.NewSessionWithOptions(session.Options{
|
||||
// sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
// Config: aws.Config{Region: aws.String("us-east-1")},
|
||||
// Profile: "profile_name",
|
||||
// })
|
||||
// }))
|
||||
//
|
||||
// // Force enable Shared Config support
|
||||
// sess, err := session.NewSessionWithOptions(session.Options{
|
||||
// sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
// SharedConfigState: SharedConfigEnable,
|
||||
// })
|
||||
// }))
|
||||
func NewSessionWithOptions(opts Options) (*Session, error) {
|
||||
var envCfg envConfig
|
||||
if opts.SharedConfigState == SharedConfigEnable {
|
||||
@ -197,7 +239,18 @@ func NewSessionWithOptions(opts Options) (*Session, error) {
|
||||
envCfg.EnableSharedConfig = true
|
||||
}
|
||||
|
||||
return newSession(envCfg, &opts.Config)
|
||||
// Only use AWS_CA_BUNDLE if session option is not provided.
|
||||
if len(envCfg.CustomCABundle) != 0 && opts.CustomCABundle == nil {
|
||||
f, err := os.Open(envCfg.CustomCABundle)
|
||||
if err != nil {
|
||||
return nil, awserr.New("LoadCustomCABundleError",
|
||||
"failed to open custom CA bundle PEM file", err)
|
||||
}
|
||||
defer f.Close()
|
||||
opts.CustomCABundle = f
|
||||
}
|
||||
|
||||
return newSession(opts, envCfg, &opts.Config)
|
||||
}
|
||||
|
||||
// Must is a helper function to ensure the Session is valid and there was no
|
||||
@ -215,13 +268,18 @@ func Must(sess *Session, err error) *Session {
|
||||
return sess
|
||||
}
|
||||
|
||||
func oldNewSession(cfgs ...*aws.Config) *Session {
|
||||
func deprecatedNewSession(cfgs ...*aws.Config) *Session {
|
||||
cfg := defaults.Config()
|
||||
handlers := defaults.Handlers()
|
||||
|
||||
// Apply the passed in configs so the configuration can be applied to the
|
||||
// default credential chain
|
||||
cfg.MergeIn(cfgs...)
|
||||
if cfg.EndpointResolver == nil {
|
||||
// An endpoint resolver is required for a session to be able to provide
|
||||
// endpoints for service client configurations.
|
||||
cfg.EndpointResolver = endpoints.DefaultResolver()
|
||||
}
|
||||
cfg.Credentials = defaults.CredChain(cfg, handlers)
|
||||
|
||||
// Reapply any passed in configs to override credentials if set
|
||||
@ -237,7 +295,7 @@ func oldNewSession(cfgs ...*aws.Config) *Session {
|
||||
return s
|
||||
}
|
||||
|
||||
func newSession(envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
||||
func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
||||
cfg := defaults.Config()
|
||||
handlers := defaults.Handlers()
|
||||
|
||||
@ -261,7 +319,9 @@ func newSession(envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers)
|
||||
if err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s := &Session{
|
||||
Config: cfg,
|
||||
@ -270,10 +330,62 @@ func newSession(envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
||||
|
||||
initHandlers(s)
|
||||
|
||||
// Setup HTTP client with custom cert bundle if enabled
|
||||
if opts.CustomCABundle != nil {
|
||||
if err := loadCustomCABundle(s, opts.CustomCABundle); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers) {
|
||||
func loadCustomCABundle(s *Session, bundle io.Reader) error {
|
||||
var t *http.Transport
|
||||
switch v := s.Config.HTTPClient.Transport.(type) {
|
||||
case *http.Transport:
|
||||
t = v
|
||||
default:
|
||||
if s.Config.HTTPClient.Transport != nil {
|
||||
return awserr.New("LoadCustomCABundleError",
|
||||
"unable to load custom CA bundle, HTTPClient's transport unsupported type", nil)
|
||||
}
|
||||
}
|
||||
if t == nil {
|
||||
t = &http.Transport{}
|
||||
}
|
||||
|
||||
p, err := loadCertPool(bundle)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if t.TLSClientConfig == nil {
|
||||
t.TLSClientConfig = &tls.Config{}
|
||||
}
|
||||
t.TLSClientConfig.RootCAs = p
|
||||
|
||||
s.Config.HTTPClient.Transport = t
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func loadCertPool(r io.Reader) (*x509.CertPool, error) {
|
||||
b, err := ioutil.ReadAll(r)
|
||||
if err != nil {
|
||||
return nil, awserr.New("LoadCustomCABundleError",
|
||||
"failed to read custom CA bundle PEM file", err)
|
||||
}
|
||||
|
||||
p := x509.NewCertPool()
|
||||
if !p.AppendCertsFromPEM(b) {
|
||||
return nil, awserr.New("LoadCustomCABundleError",
|
||||
"failed to load custom CA bundle PEM file", err)
|
||||
}
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
||||
func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options) error {
|
||||
// Merge in user provided configuration
|
||||
cfg.MergeIn(userCfg)
|
||||
|
||||
@ -297,6 +409,11 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share
|
||||
cfgCp.Credentials = credentials.NewStaticCredentialsFromCreds(
|
||||
sharedCfg.AssumeRoleSource.Creds,
|
||||
)
|
||||
if len(sharedCfg.AssumeRole.MFASerial) > 0 && sessOpts.AssumeRoleTokenProvider == nil {
|
||||
// AssumeRole Token provider is required if doing Assume Role
|
||||
// with MFA.
|
||||
return AssumeRoleTokenProviderNotSetError{}
|
||||
}
|
||||
cfg.Credentials = stscreds.NewCredentials(
|
||||
&Session{
|
||||
Config: &cfgCp,
|
||||
@ -306,11 +423,16 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share
|
||||
func(opt *stscreds.AssumeRoleProvider) {
|
||||
opt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName
|
||||
|
||||
// Assume role with external ID
|
||||
if len(sharedCfg.AssumeRole.ExternalID) > 0 {
|
||||
opt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID)
|
||||
}
|
||||
|
||||
// MFA not supported
|
||||
// Assume role with MFA
|
||||
if len(sharedCfg.AssumeRole.MFASerial) > 0 {
|
||||
opt.SerialNumber = aws.String(sharedCfg.AssumeRole.MFASerial)
|
||||
opt.TokenProvider = sessOpts.AssumeRoleTokenProvider
|
||||
}
|
||||
},
|
||||
)
|
||||
} else if len(sharedCfg.Creds.AccessKeyID) > 0 {
|
||||
@ -331,6 +453,33 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// AssumeRoleTokenProviderNotSetError is an error returned when creating a session when the
|
||||
// MFAToken option is not set when shared config is configured load assume a
|
||||
// role with an MFA token.
|
||||
type AssumeRoleTokenProviderNotSetError struct{}
|
||||
|
||||
// Code is the short id of the error.
|
||||
func (e AssumeRoleTokenProviderNotSetError) Code() string {
|
||||
return "AssumeRoleTokenProviderNotSetError"
|
||||
}
|
||||
|
||||
// Message is the description of the error
|
||||
func (e AssumeRoleTokenProviderNotSetError) Message() string {
|
||||
return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.")
|
||||
}
|
||||
|
||||
// OrigErr is the underlying error that caused the failure.
|
||||
func (e AssumeRoleTokenProviderNotSetError) OrigErr() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Error satisfies the error interface.
|
||||
func (e AssumeRoleTokenProviderNotSetError) Error() string {
|
||||
return awserr.SprintError(e.Code(), e.Message(), "", nil)
|
||||
}
|
||||
|
||||
type credProviderError struct {
|
||||
@ -375,19 +524,67 @@ func (s *Session) Copy(cfgs ...*aws.Config) *Session {
|
||||
// configure the service client instances. Passing the Session to the service
|
||||
// client's constructor (New) will use this method to configure the client.
|
||||
func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config {
|
||||
// Backwards compatibility, the error will be eaten if user calls ClientConfig
|
||||
// directly. All SDK services will use ClientconfigWithError.
|
||||
cfg, _ := s.clientConfigWithErr(serviceName, cfgs...)
|
||||
|
||||
return cfg
|
||||
}
|
||||
|
||||
func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (client.Config, error) {
|
||||
s = s.Copy(cfgs...)
|
||||
endpoint, signingRegion := endpoints.NormalizeEndpoint(
|
||||
aws.StringValue(s.Config.Endpoint),
|
||||
serviceName,
|
||||
aws.StringValue(s.Config.Region),
|
||||
aws.BoolValue(s.Config.DisableSSL),
|
||||
aws.BoolValue(s.Config.UseDualStack),
|
||||
)
|
||||
|
||||
var resolved endpoints.ResolvedEndpoint
|
||||
var err error
|
||||
|
||||
region := aws.StringValue(s.Config.Region)
|
||||
|
||||
if endpoint := aws.StringValue(s.Config.Endpoint); len(endpoint) != 0 {
|
||||
resolved.URL = endpoints.AddScheme(endpoint, aws.BoolValue(s.Config.DisableSSL))
|
||||
resolved.SigningRegion = region
|
||||
} else {
|
||||
resolved, err = s.Config.EndpointResolver.EndpointFor(
|
||||
serviceName, region,
|
||||
func(opt *endpoints.Options) {
|
||||
opt.DisableSSL = aws.BoolValue(s.Config.DisableSSL)
|
||||
opt.UseDualStack = aws.BoolValue(s.Config.UseDualStack)
|
||||
|
||||
// Support the condition where the service is modeled but its
|
||||
// endpoint metadata is not available.
|
||||
opt.ResolveUnknownService = true
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
return client.Config{
|
||||
Config: s.Config,
|
||||
Handlers: s.Handlers,
|
||||
Endpoint: endpoint,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: resolved.URL,
|
||||
SigningRegion: resolved.SigningRegion,
|
||||
SigningName: resolved.SigningName,
|
||||
}, err
|
||||
}
|
||||
|
||||
// ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception
|
||||
// that the EndpointResolver will not be used to resolve the endpoint. The only
|
||||
// endpoint set must come from the aws.Config.Endpoint field.
|
||||
func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Config {
|
||||
s = s.Copy(cfgs...)
|
||||
|
||||
var resolved endpoints.ResolvedEndpoint
|
||||
|
||||
region := aws.StringValue(s.Config.Region)
|
||||
|
||||
if ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 {
|
||||
resolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL))
|
||||
resolved.SigningRegion = region
|
||||
}
|
||||
|
||||
return client.Config{
|
||||
Config: s.Config,
|
||||
Handlers: s.Handlers,
|
||||
Endpoint: resolved.URL,
|
||||
SigningRegion: resolved.SigningRegion,
|
||||
SigningName: resolved.SigningName,
|
||||
}
|
||||
}
|
||||
|
7
vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go
generated
vendored
Normal file
7
vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
package v4
|
||||
|
||||
// WithUnsignedPayload will enable and set the UnsignedPayload field to
|
||||
// true of the signer.
|
||||
func WithUnsignedPayload(v4 *Signer) {
|
||||
v4.UnsignedPayload = true
|
||||
}
|
24
vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path_1_4.go
generated
vendored
24
vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path_1_4.go
generated
vendored
@ -1,24 +0,0 @@
|
||||
// +build !go1.5
|
||||
|
||||
package v4
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func getURIPath(u *url.URL) string {
|
||||
var uri string
|
||||
|
||||
if len(u.Opaque) > 0 {
|
||||
uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/")
|
||||
} else {
|
||||
uri = u.Path
|
||||
}
|
||||
|
||||
if len(uri) == 0 {
|
||||
uri = "/"
|
||||
}
|
||||
|
||||
return uri
|
||||
}
|
56
vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go
generated
vendored
56
vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go
generated
vendored
@ -42,6 +42,14 @@
|
||||
// the URL.Opaque or URL.RawPath. The SDK will use URL.Opaque first and then
|
||||
// call URL.EscapedPath() if Opaque is not set.
|
||||
//
|
||||
// If signing a request intended for HTTP2 server, and you're using Go 1.6.2
|
||||
// through 1.7.4 you should use the URL.RawPath as the pre-escaped form of the
|
||||
// request URL. https://github.com/golang/go/issues/16847 points to a bug in
|
||||
// Go pre 1.8 that failes to make HTTP2 requests using absolute URL in the HTTP
|
||||
// message. URL.Opaque generally will force Go to make requests with absolute URL.
|
||||
// URL.RawPath does not do this, but RawPath must be a valid escaping of Path
|
||||
// or url.EscapedPath will ignore the RawPath escaping.
|
||||
//
|
||||
// Test `TestStandaloneSign` provides a complete example of using the signer
|
||||
// outside of the SDK and pre-escaping the URI path.
|
||||
package v4
|
||||
@ -79,8 +87,9 @@ const (
|
||||
var ignoredHeaders = rules{
|
||||
blacklist{
|
||||
mapRule{
|
||||
"Authorization": struct{}{},
|
||||
"User-Agent": struct{}{},
|
||||
"Authorization": struct{}{},
|
||||
"User-Agent": struct{}{},
|
||||
"X-Amzn-Trace-Id": struct{}{},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -171,10 +180,24 @@ type Signer struct {
|
||||
// http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
|
||||
DisableURIPathEscaping bool
|
||||
|
||||
// Disales the automatical setting of the HTTP request's Body field with the
|
||||
// io.ReadSeeker passed in to the signer. This is useful if you're using a
|
||||
// custom wrapper around the body for the io.ReadSeeker and want to preserve
|
||||
// the Body value on the Request.Body.
|
||||
//
|
||||
// This does run the risk of signing a request with a body that will not be
|
||||
// sent in the request. Need to ensure that the underlying data of the Body
|
||||
// values are the same.
|
||||
DisableRequestBodyOverwrite bool
|
||||
|
||||
// currentTimeFn returns the time value which represents the current time.
|
||||
// This value should only be used for testing. If it is nil the default
|
||||
// time.Now will be used.
|
||||
currentTimeFn func() time.Time
|
||||
|
||||
// UnsignedPayload will prevent signing of the payload. This will only
|
||||
// work for services that have support for this.
|
||||
UnsignedPayload bool
|
||||
}
|
||||
|
||||
// NewSigner returns a Signer pointer configured with the credentials and optional
|
||||
@ -208,6 +231,7 @@ type signingCtx struct {
|
||||
isPresign bool
|
||||
formattedTime string
|
||||
formattedShortTime string
|
||||
unsignedPayload bool
|
||||
|
||||
bodyDigest string
|
||||
signedHeaders string
|
||||
@ -298,6 +322,7 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi
|
||||
ServiceName: service,
|
||||
Region: region,
|
||||
DisableURIPathEscaping: v4.DisableURIPathEscaping,
|
||||
unsignedPayload: v4.UnsignedPayload,
|
||||
}
|
||||
|
||||
for key := range ctx.Query {
|
||||
@ -321,7 +346,7 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi
|
||||
// If the request is not presigned the body should be attached to it. This
|
||||
// prevents the confusion of wanting to send a signed request without
|
||||
// the body the request was signed for attached.
|
||||
if !ctx.isPresign {
|
||||
if !(v4.DisableRequestBodyOverwrite || ctx.isPresign) {
|
||||
var reader io.ReadCloser
|
||||
if body != nil {
|
||||
var ok bool
|
||||
@ -390,7 +415,18 @@ var SignRequestHandler = request.NamedHandler{
|
||||
func SignSDKRequest(req *request.Request) {
|
||||
signSDKRequestWithCurrTime(req, time.Now)
|
||||
}
|
||||
func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time) {
|
||||
|
||||
// BuildNamedHandler will build a generic handler for signing.
|
||||
func BuildNamedHandler(name string, opts ...func(*Signer)) request.NamedHandler {
|
||||
return request.NamedHandler{
|
||||
Name: name,
|
||||
Fn: func(req *request.Request) {
|
||||
signSDKRequestWithCurrTime(req, time.Now, opts...)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) {
|
||||
// If the request does not need to be signed ignore the signing of the
|
||||
// request if the AnonymousCredentials object is used.
|
||||
if req.Config.Credentials == credentials.AnonymousCredentials {
|
||||
@ -416,8 +452,16 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time
|
||||
// S3 service should not have any escaping applied
|
||||
v4.DisableURIPathEscaping = true
|
||||
}
|
||||
// Prevents setting the HTTPRequest's Body. Since the Body could be
|
||||
// wrapped in a custom io.Closer that we do not want to be stompped
|
||||
// on top of by the signer.
|
||||
v4.DisableRequestBodyOverwrite = true
|
||||
})
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(v4)
|
||||
}
|
||||
|
||||
signingTime := req.Time
|
||||
if !req.LastSignedAt.IsZero() {
|
||||
signingTime = req.LastSignedAt
|
||||
@ -611,14 +655,14 @@ func (ctx *signingCtx) buildSignature() {
|
||||
func (ctx *signingCtx) buildBodyDigest() {
|
||||
hash := ctx.Request.Header.Get("X-Amz-Content-Sha256")
|
||||
if hash == "" {
|
||||
if ctx.isPresign && ctx.ServiceName == "s3" {
|
||||
if ctx.unsignedPayload || (ctx.isPresign && ctx.ServiceName == "s3") {
|
||||
hash = "UNSIGNED-PAYLOAD"
|
||||
} else if ctx.Body == nil {
|
||||
hash = emptyStringSHA256
|
||||
} else {
|
||||
hash = hex.EncodeToString(makeSha256Reader(ctx.Body))
|
||||
}
|
||||
if ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" {
|
||||
if ctx.unsignedPayload || ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" {
|
||||
ctx.Request.Header.Set("X-Amz-Content-Sha256", hash)
|
||||
}
|
||||
}
|
||||
|
16
vendor/github.com/aws/aws-sdk-go/aws/types.go
generated
vendored
16
vendor/github.com/aws/aws-sdk-go/aws/types.go
generated
vendored
@ -5,7 +5,13 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser
|
||||
// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Should
|
||||
// only be used with an io.Reader that is also an io.Seeker. Doing so may
|
||||
// cause request signature errors, or request body's not sent for GET, HEAD
|
||||
// and DELETE HTTP methods.
|
||||
//
|
||||
// Deprecated: Should only be used with io.ReadSeeker. If using for
|
||||
// S3 PutObject to stream content use s3manager.Uploader instead.
|
||||
func ReadSeekCloser(r io.Reader) ReaderSeekerCloser {
|
||||
return ReaderSeekerCloser{r}
|
||||
}
|
||||
@ -44,6 +50,12 @@ func (r ReaderSeekerCloser) Seek(offset int64, whence int) (int64, error) {
|
||||
return int64(0), nil
|
||||
}
|
||||
|
||||
// IsSeeker returns if the underlying reader is also a seeker.
|
||||
func (r ReaderSeekerCloser) IsSeeker() bool {
|
||||
_, ok := r.r.(io.Seeker)
|
||||
return ok
|
||||
}
|
||||
|
||||
// Close closes the ReaderSeekerCloser.
|
||||
//
|
||||
// If the ReaderSeekerCloser is not an io.Closer nothing will be done.
|
||||
@ -102,5 +114,5 @@ func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) {
|
||||
func (b *WriteAtBuffer) Bytes() []byte {
|
||||
b.m.Lock()
|
||||
defer b.m.Unlock()
|
||||
return b.buf[:len(b.buf):len(b.buf)]
|
||||
return b.buf
|
||||
}
|
||||
|
2
vendor/github.com/aws/aws-sdk-go/aws/version.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go/aws/version.go
generated
vendored
@ -5,4 +5,4 @@ package aws
|
||||
const SDKName = "aws-sdk-go"
|
||||
|
||||
// SDKVersion is the version of this SDK
|
||||
const SDKVersion = "1.5.8"
|
||||
const SDKVersion = "1.8.11"
|
||||
|
70
vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go
generated
vendored
70
vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go
generated
vendored
@ -1,70 +0,0 @@
|
||||
// Package endpoints validates regional endpoints for services.
|
||||
package endpoints
|
||||
|
||||
//go:generate go run -tags codegen ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go
|
||||
//go:generate gofmt -s -w endpoints_map.go
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// NormalizeEndpoint takes and endpoint and service API information to return a
|
||||
// normalized endpoint and signing region. If the endpoint is not an empty string
|
||||
// the service name and region will be used to look up the service's API endpoint.
|
||||
// If the endpoint is provided the scheme will be added if it is not present.
|
||||
func NormalizeEndpoint(endpoint, serviceName, region string, disableSSL, useDualStack bool) (normEndpoint, signingRegion string) {
|
||||
if endpoint == "" {
|
||||
return EndpointForRegion(serviceName, region, disableSSL, useDualStack)
|
||||
}
|
||||
|
||||
return AddScheme(endpoint, disableSSL), ""
|
||||
}
|
||||
|
||||
// EndpointForRegion returns an endpoint and its signing region for a service and region.
|
||||
// if the service and region pair are not found endpoint and signingRegion will be empty.
|
||||
func EndpointForRegion(svcName, region string, disableSSL, useDualStack bool) (endpoint, signingRegion string) {
|
||||
dualStackField := ""
|
||||
if useDualStack {
|
||||
dualStackField = "/dualstack"
|
||||
}
|
||||
|
||||
derivedKeys := []string{
|
||||
region + "/" + svcName + dualStackField,
|
||||
region + "/*" + dualStackField,
|
||||
"*/" + svcName + dualStackField,
|
||||
"*/*" + dualStackField,
|
||||
}
|
||||
|
||||
for _, key := range derivedKeys {
|
||||
if val, ok := endpointsMap.Endpoints[key]; ok {
|
||||
ep := val.Endpoint
|
||||
ep = strings.Replace(ep, "{region}", region, -1)
|
||||
ep = strings.Replace(ep, "{service}", svcName, -1)
|
||||
|
||||
endpoint = ep
|
||||
signingRegion = val.SigningRegion
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return AddScheme(endpoint, disableSSL), signingRegion
|
||||
}
|
||||
|
||||
// Regular expression to determine if the endpoint string is prefixed with a scheme.
|
||||
var schemeRE = regexp.MustCompile("^([^:]+)://")
|
||||
|
||||
// AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no
|
||||
// scheme. If disableSSL is true HTTP will be added instead of the default HTTPS.
|
||||
func AddScheme(endpoint string, disableSSL bool) string {
|
||||
if endpoint != "" && !schemeRE.MatchString(endpoint) {
|
||||
scheme := "https"
|
||||
if disableSSL {
|
||||
scheme = "http"
|
||||
}
|
||||
endpoint = fmt.Sprintf("%s://%s", scheme, endpoint)
|
||||
}
|
||||
|
||||
return endpoint
|
||||
}
|
82
vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json
generated
vendored
82
vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json
generated
vendored
@ -1,82 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"endpoints": {
|
||||
"*/*": {
|
||||
"endpoint": "{service}.{region}.amazonaws.com"
|
||||
},
|
||||
"cn-north-1/*": {
|
||||
"endpoint": "{service}.{region}.amazonaws.com.cn",
|
||||
"signatureVersion": "v4"
|
||||
},
|
||||
"cn-north-1/ec2metadata": {
|
||||
"endpoint": "http://169.254.169.254/latest"
|
||||
},
|
||||
"us-gov-west-1/iam": {
|
||||
"endpoint": "iam.us-gov.amazonaws.com"
|
||||
},
|
||||
"us-gov-west-1/sts": {
|
||||
"endpoint": "sts.us-gov-west-1.amazonaws.com"
|
||||
},
|
||||
"us-gov-west-1/s3": {
|
||||
"endpoint": "s3-{region}.amazonaws.com"
|
||||
},
|
||||
"us-gov-west-1/ec2metadata": {
|
||||
"endpoint": "http://169.254.169.254/latest"
|
||||
},
|
||||
"*/budgets": {
|
||||
"endpoint": "budgets.amazonaws.com",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"*/cloudfront": {
|
||||
"endpoint": "cloudfront.amazonaws.com",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"*/cloudsearchdomain": {
|
||||
"endpoint": "",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"*/data.iot": {
|
||||
"endpoint": "",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"*/ec2metadata": {
|
||||
"endpoint": "http://169.254.169.254/latest"
|
||||
},
|
||||
"*/iam": {
|
||||
"endpoint": "iam.amazonaws.com",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"*/importexport": {
|
||||
"endpoint": "importexport.amazonaws.com",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"*/route53": {
|
||||
"endpoint": "route53.amazonaws.com",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"*/sts": {
|
||||
"endpoint": "sts.amazonaws.com",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"*/waf": {
|
||||
"endpoint": "waf.amazonaws.com",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"us-east-1/sdb": {
|
||||
"endpoint": "sdb.amazonaws.com",
|
||||
"signingRegion": "us-east-1"
|
||||
},
|
||||
"*/s3": {
|
||||
"endpoint": "s3-{region}.amazonaws.com"
|
||||
},
|
||||
"*/s3/dualstack": {
|
||||
"endpoint": "s3.dualstack.{region}.amazonaws.com"
|
||||
},
|
||||
"us-east-1/s3": {
|
||||
"endpoint": "s3.amazonaws.com"
|
||||
},
|
||||
"eu-central-1/s3": {
|
||||
"endpoint": "{service}.{region}.amazonaws.com"
|
||||
}
|
||||
}
|
||||
}
|
95
vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go
generated
vendored
95
vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go
generated
vendored
@ -1,95 +0,0 @@
|
||||
package endpoints
|
||||
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
type endpointStruct struct {
|
||||
Version int
|
||||
Endpoints map[string]endpointEntry
|
||||
}
|
||||
|
||||
type endpointEntry struct {
|
||||
Endpoint string
|
||||
SigningRegion string
|
||||
}
|
||||
|
||||
var endpointsMap = endpointStruct{
|
||||
Version: 2,
|
||||
Endpoints: map[string]endpointEntry{
|
||||
"*/*": {
|
||||
Endpoint: "{service}.{region}.amazonaws.com",
|
||||
},
|
||||
"*/budgets": {
|
||||
Endpoint: "budgets.amazonaws.com",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"*/cloudfront": {
|
||||
Endpoint: "cloudfront.amazonaws.com",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"*/cloudsearchdomain": {
|
||||
Endpoint: "",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"*/data.iot": {
|
||||
Endpoint: "",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"*/ec2metadata": {
|
||||
Endpoint: "http://169.254.169.254/latest",
|
||||
},
|
||||
"*/iam": {
|
||||
Endpoint: "iam.amazonaws.com",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"*/importexport": {
|
||||
Endpoint: "importexport.amazonaws.com",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"*/route53": {
|
||||
Endpoint: "route53.amazonaws.com",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"*/s3": {
|
||||
Endpoint: "s3-{region}.amazonaws.com",
|
||||
},
|
||||
"*/s3/dualstack": {
|
||||
Endpoint: "s3.dualstack.{region}.amazonaws.com",
|
||||
},
|
||||
"*/sts": {
|
||||
Endpoint: "sts.amazonaws.com",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"*/waf": {
|
||||
Endpoint: "waf.amazonaws.com",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"cn-north-1/*": {
|
||||
Endpoint: "{service}.{region}.amazonaws.com.cn",
|
||||
},
|
||||
"cn-north-1/ec2metadata": {
|
||||
Endpoint: "http://169.254.169.254/latest",
|
||||
},
|
||||
"eu-central-1/s3": {
|
||||
Endpoint: "{service}.{region}.amazonaws.com",
|
||||
},
|
||||
"us-east-1/s3": {
|
||||
Endpoint: "s3.amazonaws.com",
|
||||
},
|
||||
"us-east-1/sdb": {
|
||||
Endpoint: "sdb.amazonaws.com",
|
||||
SigningRegion: "us-east-1",
|
||||
},
|
||||
"us-gov-west-1/ec2metadata": {
|
||||
Endpoint: "http://169.254.169.254/latest",
|
||||
},
|
||||
"us-gov-west-1/iam": {
|
||||
Endpoint: "iam.us-gov.amazonaws.com",
|
||||
},
|
||||
"us-gov-west-1/s3": {
|
||||
Endpoint: "s3-{region}.amazonaws.com",
|
||||
},
|
||||
"us-gov-west-1/sts": {
|
||||
Endpoint: "sts.us-gov-west-1.amazonaws.com",
|
||||
},
|
||||
},
|
||||
}
|
213
vendor/github.com/aws/aws-sdk-go/private/model/api/api.go
generated
vendored
213
vendor/github.com/aws/aws-sdk-go/private/model/api/api.go
generated
vendored
@ -5,8 +5,11 @@ package api
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
@ -48,6 +51,8 @@ type API struct {
|
||||
imports map[string]bool
|
||||
name string
|
||||
path string
|
||||
|
||||
BaseCrosslinkURL string
|
||||
}
|
||||
|
||||
// A Metadata is the metadata about an API's definition.
|
||||
@ -61,6 +66,21 @@ type Metadata struct {
|
||||
JSONVersion string
|
||||
TargetPrefix string
|
||||
Protocol string
|
||||
UID string
|
||||
EndpointsID string
|
||||
|
||||
NoResolveEndpoint bool
|
||||
}
|
||||
|
||||
var serviceAliases map[string]string
|
||||
|
||||
func Bootstrap() error {
|
||||
b, err := ioutil.ReadFile(filepath.Join("..", "models", "customizations", "service-aliases.json"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return json.Unmarshal(b, &serviceAliases)
|
||||
}
|
||||
|
||||
// PackageName name of the API package
|
||||
@ -84,14 +104,9 @@ func (a *API) StructName() string {
|
||||
}
|
||||
|
||||
name = nameRegex.ReplaceAllString(name, "")
|
||||
switch strings.ToLower(name) {
|
||||
case "elasticloadbalancing":
|
||||
a.name = "ELB"
|
||||
case "elasticloadbalancingv2":
|
||||
a.name = "ELBV2"
|
||||
case "config":
|
||||
a.name = "ConfigService"
|
||||
default:
|
||||
|
||||
a.name = name
|
||||
if name, ok := serviceAliases[strings.ToLower(name)]; ok {
|
||||
a.name = name
|
||||
}
|
||||
}
|
||||
@ -172,10 +187,21 @@ func (a *API) ShapeList() []*Shape {
|
||||
list := make([]*Shape, 0, len(a.Shapes))
|
||||
for _, n := range a.ShapeNames() {
|
||||
// Ignore error shapes in list
|
||||
if a.Shapes[n].IsError {
|
||||
continue
|
||||
if s := a.Shapes[n]; !s.IsError {
|
||||
list = append(list, s)
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
// ShapeListErrors returns a list of the errors defined by the API model
|
||||
func (a *API) ShapeListErrors() []*Shape {
|
||||
list := []*Shape{}
|
||||
for _, n := range a.ShapeNames() {
|
||||
// Ignore error shapes in list
|
||||
if s := a.Shapes[n]; s.IsError {
|
||||
list = append(list, s)
|
||||
}
|
||||
list = append(list, a.Shapes[n])
|
||||
}
|
||||
return list
|
||||
}
|
||||
@ -239,7 +265,6 @@ var tplAPI = template.Must(template.New("api").Parse(`
|
||||
// APIGoCode renders the API in Go code. Returning it as a string
|
||||
func (a *API) APIGoCode() string {
|
||||
a.resetImports()
|
||||
delete(a.imports, "github.com/aws/aws-sdk-go/aws")
|
||||
a.imports["github.com/aws/aws-sdk-go/aws/awsutil"] = true
|
||||
a.imports["github.com/aws/aws-sdk-go/aws/request"] = true
|
||||
if a.OperationHasOutputPlaceholder() {
|
||||
@ -264,10 +289,69 @@ func (a *API) APIGoCode() string {
|
||||
return code
|
||||
}
|
||||
|
||||
var noCrossLinkServices = map[string]struct{}{
|
||||
"apigateway": struct{}{},
|
||||
"budgets": struct{}{},
|
||||
"cloudsearch": struct{}{},
|
||||
"cloudsearchdomain": struct{}{},
|
||||
"discovery": struct{}{},
|
||||
"elastictranscoder": struct{}{},
|
||||
"es": struct{}{},
|
||||
"glacier": struct{}{},
|
||||
"importexport": struct{}{},
|
||||
"iot": struct{}{},
|
||||
"iot-data": struct{}{},
|
||||
"lambda": struct{}{},
|
||||
"machinelearning": struct{}{},
|
||||
"rekognition": struct{}{},
|
||||
"sdb": struct{}{},
|
||||
"swf": struct{}{},
|
||||
}
|
||||
|
||||
func GetCrosslinkURL(baseURL, name, uid string, params ...string) string {
|
||||
_, ok := noCrossLinkServices[strings.ToLower(name)]
|
||||
if uid != "" && baseURL != "" && !ok {
|
||||
return strings.Join(append([]string{baseURL, "goto", "WebAPI", uid}, params...), "/")
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (a *API) APIName() string {
|
||||
return a.name
|
||||
}
|
||||
|
||||
// A tplService defines the template for the service generated code.
|
||||
var tplService = template.Must(template.New("service").Parse(`
|
||||
{{ .Documentation }}//The service client's operations are safe to be used concurrently.
|
||||
var tplService = template.Must(template.New("service").Funcs(template.FuncMap{
|
||||
"ServiceNameValue": func(a *API) string {
|
||||
if a.NoConstServiceNames {
|
||||
return fmt.Sprintf("%q", a.Metadata.EndpointPrefix)
|
||||
}
|
||||
return "ServiceName"
|
||||
},
|
||||
"GetCrosslinkURL": GetCrosslinkURL,
|
||||
"EndpointsIDConstValue": func(a *API) string {
|
||||
if a.NoConstServiceNames {
|
||||
return fmt.Sprintf("%q", a.Metadata.EndpointPrefix)
|
||||
}
|
||||
if a.Metadata.EndpointPrefix == a.Metadata.EndpointsID {
|
||||
return "ServiceName"
|
||||
}
|
||||
return fmt.Sprintf("%q", a.Metadata.EndpointsID)
|
||||
},
|
||||
"EndpointsIDValue": func(a *API) string {
|
||||
if a.NoConstServiceNames {
|
||||
return fmt.Sprintf("%q", a.Metadata.EndpointPrefix)
|
||||
}
|
||||
|
||||
return "EndpointsID"
|
||||
},
|
||||
}).Parse(`
|
||||
{{ .Documentation }}// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
{{ $crosslinkURL := GetCrosslinkURL $.BaseCrosslinkURL $.APIName $.Metadata.UID -}}
|
||||
{{ if ne $crosslinkURL "" -}}
|
||||
// Please also see {{ $crosslinkURL }}
|
||||
{{ end -}}
|
||||
type {{ .StructName }} struct {
|
||||
*client.Client
|
||||
}
|
||||
@ -279,10 +363,14 @@ var initClient func(*client.Client)
|
||||
var initRequest func(*request.Request)
|
||||
{{ end }}
|
||||
|
||||
{{ if not .NoConstServiceNames }}
|
||||
// A ServiceName is the name of the service the client will make API calls to.
|
||||
const ServiceName = "{{ .Metadata.EndpointPrefix }}"
|
||||
{{ end }}
|
||||
|
||||
{{ if not .NoConstServiceNames -}}
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "{{ .Metadata.EndpointPrefix }}" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = {{ EndpointsIDConstValue . }} // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
{{- end }}
|
||||
|
||||
// New creates a new instance of the {{ .StructName }} client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
@ -295,24 +383,41 @@ const ServiceName = "{{ .Metadata.EndpointPrefix }}"
|
||||
// // Create a {{ .StructName }} client with additional configuration
|
||||
// svc := {{ .PackageName }}.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *{{ .StructName }} {
|
||||
c := p.ClientConfig({{ if .NoConstServiceNames }}"{{ .Metadata.EndpointPrefix }}"{{ else }}ServiceName{{ end }}, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
|
||||
{{ if .Metadata.NoResolveEndpoint -}}
|
||||
var c client.Config
|
||||
if v, ok := p.(client.ConfigNoResolveEndpointProvider); ok {
|
||||
c = v.ClientConfigNoResolveEndpoint(cfgs...)
|
||||
} else {
|
||||
c = p.ClientConfig({{ EndpointsIDValue . }}, cfgs...)
|
||||
}
|
||||
{{- else -}}
|
||||
c := p.ClientConfig({{ EndpointsIDValue . }}, cfgs...)
|
||||
{{- end }}
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *{{ .StructName }} {
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *{{ .StructName }} {
|
||||
{{- if .Metadata.SigningName }}
|
||||
if len(signingName) == 0 {
|
||||
signingName = "{{ .Metadata.SigningName }}"
|
||||
}
|
||||
{{- end }}
|
||||
svc := &{{ .StructName }}{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: {{ if .NoConstServiceNames }}"{{ .Metadata.EndpointPrefix }}"{{ else }}ServiceName{{ end }}, {{ if ne .Metadata.SigningName "" }}
|
||||
SigningName: "{{ .Metadata.SigningName }}",{{ end }}
|
||||
ServiceName: {{ ServiceNameValue . }},
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "{{ .Metadata.APIVersion }}",
|
||||
{{ if eq .Metadata.Protocol "json" }}JSONVersion: "{{ .Metadata.JSONVersion }}",
|
||||
TargetPrefix: "{{ .Metadata.TargetPrefix }}",
|
||||
{{ end }}
|
||||
{{ if .Metadata.JSONVersion -}}
|
||||
JSONVersion: "{{ .Metadata.JSONVersion }}",
|
||||
{{- end }}
|
||||
{{ if .Metadata.TargetPrefix -}}
|
||||
TargetPrefix: "{{ .Metadata.TargetPrefix }}",
|
||||
{{- end }}
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
@ -320,8 +425,10 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed({{if eq .Metadata.SignatureVersion "v2"}}v2{{else}}v4{{end}}.SignRequestHandler)
|
||||
{{if eq .Metadata.SignatureVersion "v2"}}svc.Handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
|
||||
{{end}}svc.Handlers.Build.PushBackNamed({{ .ProtocolPackage }}.BuildHandler)
|
||||
{{- if eq .Metadata.SignatureVersion "v2" }}
|
||||
svc.Handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
|
||||
{{- end }}
|
||||
svc.Handlers.Build.PushBackNamed({{ .ProtocolPackage }}.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed({{ .ProtocolPackage }}.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed({{ .ProtocolPackage }}.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed({{ .ProtocolPackage }}.UnmarshalErrorHandler)
|
||||
@ -377,20 +484,29 @@ func (a *API) ServiceGoCode() string {
|
||||
// ExampleGoCode renders service example code. Returning it as a string.
|
||||
func (a *API) ExampleGoCode() string {
|
||||
exs := []string{}
|
||||
imports := map[string]bool{}
|
||||
for _, o := range a.OperationList() {
|
||||
o.imports = map[string]bool{}
|
||||
exs = append(exs, o.Example())
|
||||
for k, v := range o.imports {
|
||||
imports[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
code := fmt.Sprintf("import (\n%q\n%q\n%q\n\n%q\n%q\n%q\n)\n\n"+
|
||||
"var _ time.Duration\nvar _ bytes.Buffer\n\n%s",
|
||||
code := fmt.Sprintf("import (\n%q\n%q\n%q\n\n%q\n%q\n%q\n",
|
||||
"bytes",
|
||||
"fmt",
|
||||
"time",
|
||||
"github.com/aws/aws-sdk-go/aws",
|
||||
"github.com/aws/aws-sdk-go/aws/session",
|
||||
path.Join(a.SvcClientImportPath, a.PackageName()),
|
||||
strings.Join(exs, "\n\n"),
|
||||
)
|
||||
for k, _ := range imports {
|
||||
code += fmt.Sprintf("%q\n", k)
|
||||
}
|
||||
code += ")\n\n"
|
||||
code += "var _ time.Duration\nvar _ bytes.Buffer\n\n"
|
||||
code += strings.Join(exs, "\n\n")
|
||||
return code
|
||||
}
|
||||
|
||||
@ -428,7 +544,7 @@ var tplInterface = template.Must(template.New("interface").Parse(`
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// TestMyFunc(t *testing.T) {
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mock{{ .StructName }}Client{}
|
||||
//
|
||||
@ -459,6 +575,7 @@ var _ {{ .StructName }}API = (*{{ .PackageName }}.{{ .StructName }})(nil)
|
||||
func (a *API) InterfaceGoCode() string {
|
||||
a.resetImports()
|
||||
a.imports = map[string]bool{
|
||||
"github.com/aws/aws-sdk-go/aws": true,
|
||||
"github.com/aws/aws-sdk-go/aws/request": true,
|
||||
path.Join(a.SvcClientImportPath, a.PackageName()): true,
|
||||
}
|
||||
@ -521,6 +638,12 @@ func resolveShapeValidations(s *Shape, ancestry ...*Shape) {
|
||||
ancestry = append(ancestry, s)
|
||||
for _, name := range children {
|
||||
ref := s.MemberRefs[name]
|
||||
// Since this is a grab bag we will just continue since
|
||||
// we can't validate because we don't know the valued shape.
|
||||
if ref.JSONValue {
|
||||
continue
|
||||
}
|
||||
|
||||
nestedShape := ref.Shape.NestedShape()
|
||||
|
||||
var v *ShapeValidation
|
||||
@ -543,3 +666,29 @@ func resolveShapeValidations(s *Shape, ancestry ...*Shape) {
|
||||
}
|
||||
ancestry = ancestry[:len(ancestry)-1]
|
||||
}
|
||||
|
||||
// A tplAPIErrors is the top level template for the API
|
||||
var tplAPIErrors = template.Must(template.New("api").Parse(`
|
||||
const (
|
||||
{{ range $_, $s := $.ShapeListErrors }}
|
||||
// {{ $s.ErrorCodeName }} for service response error code
|
||||
// {{ printf "%q" $s.ErrorName }}.
|
||||
{{ if $s.Docstring -}}
|
||||
//
|
||||
{{ $s.Docstring }}
|
||||
{{ end -}}
|
||||
{{ $s.ErrorCodeName }} = {{ printf "%q" $s.ErrorName }}
|
||||
{{ end }}
|
||||
)
|
||||
`))
|
||||
|
||||
func (a *API) APIErrorsGoCode() string {
|
||||
var buf bytes.Buffer
|
||||
err := tplAPIErrors.Execute(&buf, a)
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return strings.TrimSpace(buf.String())
|
||||
}
|
||||
|
92
vendor/github.com/aws/aws-sdk-go/private/model/api/customization_passes.go
generated
vendored
92
vendor/github.com/aws/aws-sdk-go/private/model/api/customization_passes.go
generated
vendored
@ -4,16 +4,45 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type service struct {
|
||||
srcName string
|
||||
dstName string
|
||||
|
||||
serviceVersion string
|
||||
}
|
||||
|
||||
var mergeServices = map[string]service{
|
||||
"dynamodbstreams": service{
|
||||
dstName: "dynamodb",
|
||||
srcName: "streams.dynamodb",
|
||||
},
|
||||
"wafregional": service{
|
||||
dstName: "waf",
|
||||
srcName: "waf-regional",
|
||||
serviceVersion: "2015-08-24",
|
||||
},
|
||||
}
|
||||
|
||||
// customizationPasses Executes customization logic for the API by package name.
|
||||
func (a *API) customizationPasses() {
|
||||
var svcCustomizations = map[string]func(*API){
|
||||
"s3": s3Customizations,
|
||||
"cloudfront": cloudfrontCustomizations,
|
||||
"dynamodbstreams": dynamodbstreamsCustomizations,
|
||||
"s3": s3Customizations,
|
||||
"cloudfront": cloudfrontCustomizations,
|
||||
"rds": rdsCustomizations,
|
||||
|
||||
// Disable endpoint resolving for services that require customer
|
||||
// to provide endpoint them selves.
|
||||
"cloudsearchdomain": disableEndpointResolving,
|
||||
"iotdataplane": disableEndpointResolving,
|
||||
}
|
||||
|
||||
for k, _ := range mergeServices {
|
||||
svcCustomizations[k] = mergeServicesCustomizations
|
||||
}
|
||||
|
||||
if fn := svcCustomizations[a.PackageName()]; fn != nil {
|
||||
@ -89,18 +118,59 @@ func cloudfrontCustomizations(a *API) {
|
||||
}
|
||||
}
|
||||
|
||||
// dynamodbstreamsCustomizations references any duplicate shapes from DynamoDB
|
||||
func dynamodbstreamsCustomizations(a *API) {
|
||||
p := strings.Replace(a.path, "streams.dynamodb", "dynamodb", -1)
|
||||
// mergeServicesCustomizations references any duplicate shapes from DynamoDB
|
||||
func mergeServicesCustomizations(a *API) {
|
||||
info := mergeServices[a.PackageName()]
|
||||
|
||||
p := strings.Replace(a.path, info.srcName, info.dstName, -1)
|
||||
|
||||
if info.serviceVersion != "" {
|
||||
index := strings.LastIndex(p, "/")
|
||||
files, _ := ioutil.ReadDir(p[:index])
|
||||
if len(files) > 1 {
|
||||
panic("New version was introduced")
|
||||
}
|
||||
p = p[:index] + "/" + info.serviceVersion
|
||||
}
|
||||
|
||||
file := filepath.Join(p, "api-2.json")
|
||||
|
||||
dbAPI := API{}
|
||||
dbAPI.Attach(file)
|
||||
dbAPI.Setup()
|
||||
serviceAPI := API{}
|
||||
serviceAPI.Attach(file)
|
||||
serviceAPI.Setup()
|
||||
|
||||
for n := range a.Shapes {
|
||||
if _, ok := dbAPI.Shapes[n]; ok {
|
||||
a.Shapes[n].resolvePkg = "github.com/aws/aws-sdk-go/service/dynamodb"
|
||||
if _, ok := serviceAPI.Shapes[n]; ok {
|
||||
a.Shapes[n].resolvePkg = "github.com/aws/aws-sdk-go/service/" + info.dstName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rdsCustomizations are customization for the service/rds. This adds non-modeled fields used for presigning.
|
||||
func rdsCustomizations(a *API) {
|
||||
inputs := []string{
|
||||
"CopyDBSnapshotInput",
|
||||
"CreateDBInstanceReadReplicaInput",
|
||||
"CopyDBClusterSnapshotInput",
|
||||
"CreateDBClusterInput",
|
||||
}
|
||||
for _, input := range inputs {
|
||||
if ref, ok := a.Shapes[input]; ok {
|
||||
ref.MemberRefs["SourceRegion"] = &ShapeRef{
|
||||
Documentation: docstring(`SourceRegion is the source region where the resource exists. This is not sent over the wire and is only used for presigning. This value should always have the same region as the source ARN.`),
|
||||
ShapeName: "String",
|
||||
Shape: a.Shapes["String"],
|
||||
Ignore: true,
|
||||
}
|
||||
ref.MemberRefs["DestinationRegion"] = &ShapeRef{
|
||||
Documentation: docstring(`DestinationRegion is used for presigning the request to a given region.`),
|
||||
ShapeName: "String",
|
||||
Shape: a.Shapes["String"],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func disableEndpointResolving(a *API) {
|
||||
a.Metadata.NoResolveEndpoint = true
|
||||
}
|
||||
|
495
vendor/github.com/aws/aws-sdk-go/private/model/api/list_of_shame.go
generated
vendored
Normal file
495
vendor/github.com/aws/aws-sdk-go/private/model/api/list_of_shame.go
generated
vendored
Normal file
@ -0,0 +1,495 @@
|
||||
package api
|
||||
|
||||
// shamelist is used to not rename certain operation's input and output shapes.
|
||||
// We need to maintain backwards compatibility with pre-existing services. Since
|
||||
// not generating unique input/output shapes is not desired, we will generate
|
||||
// unique input/output shapes for new operations.
|
||||
var shamelist = map[string]map[string]struct {
|
||||
input bool
|
||||
output bool
|
||||
}{
|
||||
"APIGateway": {
|
||||
"CreateApiKey": {
|
||||
output: true,
|
||||
},
|
||||
"CreateAuthorizer": {
|
||||
output: true,
|
||||
},
|
||||
"CreateBasePathMapping": {
|
||||
output: true,
|
||||
},
|
||||
"CreateDeployment": {
|
||||
output: true,
|
||||
},
|
||||
"CreateDocumentationPart": {
|
||||
output: true,
|
||||
},
|
||||
"CreateDocumentationVersion": {
|
||||
output: true,
|
||||
},
|
||||
"CreateDomainName": {
|
||||
output: true,
|
||||
},
|
||||
"CreateModel": {
|
||||
output: true,
|
||||
},
|
||||
"CreateResource": {
|
||||
output: true,
|
||||
},
|
||||
"CreateRestApi": {
|
||||
output: true,
|
||||
},
|
||||
"CreateStage": {
|
||||
output: true,
|
||||
},
|
||||
"CreateUsagePlan": {
|
||||
output: true,
|
||||
},
|
||||
"CreateUsagePlanKey": {
|
||||
output: true,
|
||||
},
|
||||
"GenerateClientCertificate": {
|
||||
output: true,
|
||||
},
|
||||
"GetAccount": {
|
||||
output: true,
|
||||
},
|
||||
"GetApiKey": {
|
||||
output: true,
|
||||
},
|
||||
"GetAuthorizer": {
|
||||
output: true,
|
||||
},
|
||||
"GetBasePathMapping": {
|
||||
output: true,
|
||||
},
|
||||
"GetClientCertificate": {
|
||||
output: true,
|
||||
},
|
||||
"GetDeployment": {
|
||||
output: true,
|
||||
},
|
||||
"GetDocumentationPart": {
|
||||
output: true,
|
||||
},
|
||||
"GetDocumentationVersion": {
|
||||
output: true,
|
||||
},
|
||||
"GetDomainName": {
|
||||
output: true,
|
||||
},
|
||||
"GetIntegration": {
|
||||
output: true,
|
||||
},
|
||||
"GetIntegrationResponse": {
|
||||
output: true,
|
||||
},
|
||||
"GetMethod": {
|
||||
output: true,
|
||||
},
|
||||
"GetMethodResponse": {
|
||||
output: true,
|
||||
},
|
||||
"GetModel": {
|
||||
output: true,
|
||||
},
|
||||
"GetResource": {
|
||||
output: true,
|
||||
},
|
||||
"GetRestApi": {
|
||||
output: true,
|
||||
},
|
||||
"GetSdkType": {
|
||||
output: true,
|
||||
},
|
||||
"GetStage": {
|
||||
output: true,
|
||||
},
|
||||
"GetUsage": {
|
||||
output: true,
|
||||
},
|
||||
"GetUsagePlan": {
|
||||
output: true,
|
||||
},
|
||||
"GetUsagePlanKey": {
|
||||
output: true,
|
||||
},
|
||||
"ImportRestApi": {
|
||||
output: true,
|
||||
},
|
||||
"PutIntegration": {
|
||||
output: true,
|
||||
},
|
||||
"PutIntegrationResponse": {
|
||||
output: true,
|
||||
},
|
||||
"PutMethod": {
|
||||
output: true,
|
||||
},
|
||||
"PutMethodResponse": {
|
||||
output: true,
|
||||
},
|
||||
"PutRestApi": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateAccount": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateApiKey": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateAuthorizer": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateBasePathMapping": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateClientCertificate": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateDeployment": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateDocumentationPart": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateDocumentationVersion": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateDomainName": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateIntegration": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateIntegrationResponse": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateMethod": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateMethodResponse": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateModel": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateResource": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateRestApi": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateStage": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateUsage": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateUsagePlan": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"AutoScaling": {
|
||||
"ResumeProcesses": {
|
||||
input: true,
|
||||
},
|
||||
"SuspendProcesses": {
|
||||
input: true,
|
||||
},
|
||||
},
|
||||
"CognitoIdentity": {
|
||||
"CreateIdentityPool": {
|
||||
output: true,
|
||||
},
|
||||
"DescribeIdentity": {
|
||||
output: true,
|
||||
},
|
||||
"DescribeIdentityPool": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateIdentityPool": {
|
||||
input: true,
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"DirectConnect": {
|
||||
"AllocateConnectionOnInterconnect": {
|
||||
output: true,
|
||||
},
|
||||
"AllocateHostedConnection": {
|
||||
output: true,
|
||||
},
|
||||
"AllocatePrivateVirtualInterface": {
|
||||
output: true,
|
||||
},
|
||||
"AllocatePublicVirtualInterface": {
|
||||
output: true,
|
||||
},
|
||||
"AssociateConnectionWithLag": {
|
||||
output: true,
|
||||
},
|
||||
"AssociateHostedConnection": {
|
||||
output: true,
|
||||
},
|
||||
"AssociateVirtualInterface": {
|
||||
output: true,
|
||||
},
|
||||
"CreateConnection": {
|
||||
output: true,
|
||||
},
|
||||
"CreateInterconnect": {
|
||||
output: true,
|
||||
},
|
||||
"CreateLag": {
|
||||
output: true,
|
||||
},
|
||||
"CreatePrivateVirtualInterface": {
|
||||
output: true,
|
||||
},
|
||||
"CreatePublicVirtualInterface": {
|
||||
output: true,
|
||||
},
|
||||
"DeleteConnection": {
|
||||
output: true,
|
||||
},
|
||||
"DeleteLag": {
|
||||
output: true,
|
||||
},
|
||||
"DescribeConnections": {
|
||||
output: true,
|
||||
},
|
||||
"DescribeConnectionsOnInterconnect": {
|
||||
output: true,
|
||||
},
|
||||
"DescribeHostedConnections": {
|
||||
output: true,
|
||||
},
|
||||
"DescribeLoa": {
|
||||
output: true,
|
||||
},
|
||||
"DisassociateConnectionFromLag": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateLag": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"EC2": {
|
||||
"AttachVolume": {
|
||||
output: true,
|
||||
},
|
||||
"CreateSnapshot": {
|
||||
output: true,
|
||||
},
|
||||
"CreateVolume": {
|
||||
output: true,
|
||||
},
|
||||
"DetachVolume": {
|
||||
output: true,
|
||||
},
|
||||
"RunInstances": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"EFS": {
|
||||
"CreateFileSystem": {
|
||||
output: true,
|
||||
},
|
||||
"CreateMountTarget": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"ElastiCache": {
|
||||
"AddTagsToResource": {
|
||||
output: true,
|
||||
},
|
||||
"ListTagsForResource": {
|
||||
output: true,
|
||||
},
|
||||
"ModifyCacheParameterGroup": {
|
||||
output: true,
|
||||
},
|
||||
"RemoveTagsFromResource": {
|
||||
output: true,
|
||||
},
|
||||
"ResetCacheParameterGroup": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"ElasticBeanstalk": {
|
||||
"ComposeEnvironments": {
|
||||
output: true,
|
||||
},
|
||||
"CreateApplication": {
|
||||
output: true,
|
||||
},
|
||||
"CreateApplicationVersion": {
|
||||
output: true,
|
||||
},
|
||||
"CreateConfigurationTemplate": {
|
||||
output: true,
|
||||
},
|
||||
"CreateEnvironment": {
|
||||
output: true,
|
||||
},
|
||||
"DescribeEnvironments": {
|
||||
output: true,
|
||||
},
|
||||
"TerminateEnvironment": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateApplication": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateApplicationVersion": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateConfigurationTemplate": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateEnvironment": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"Glacier": {
|
||||
"DescribeJob": {
|
||||
output: true,
|
||||
},
|
||||
"UploadArchive": {
|
||||
output: true,
|
||||
},
|
||||
"CompleteMultipartUpload": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"IAM": {
|
||||
"GetContextKeysForCustomPolicy": {
|
||||
output: true,
|
||||
},
|
||||
"GetContextKeysForPrincipalPolicy": {
|
||||
output: true,
|
||||
},
|
||||
"SimulateCustomPolicy": {
|
||||
output: true,
|
||||
},
|
||||
"SimulatePrincipalPolicy": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"Kinesis": {
|
||||
"DisableEnhancedMonitoring": {
|
||||
output: true,
|
||||
},
|
||||
"EnableEnhancedMonitoring": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"KMS": {
|
||||
"ListGrants": {
|
||||
output: true,
|
||||
},
|
||||
"ListRetirableGrants": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"Lambda": {
|
||||
"CreateAlias": {
|
||||
output: true,
|
||||
},
|
||||
"CreateEventSourceMapping": {
|
||||
output: true,
|
||||
},
|
||||
"CreateFunction": {
|
||||
output: true,
|
||||
},
|
||||
"DeleteEventSourceMapping": {
|
||||
output: true,
|
||||
},
|
||||
"GetAlias": {
|
||||
output: true,
|
||||
},
|
||||
"GetEventSourceMapping": {
|
||||
output: true,
|
||||
},
|
||||
"GetFunctionConfiguration": {
|
||||
output: true,
|
||||
},
|
||||
"PublishVersion": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateAlias": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateEventSourceMapping": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateFunctionCode": {
|
||||
output: true,
|
||||
},
|
||||
"UpdateFunctionConfiguration": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"RDS": {
|
||||
"ModifyDBClusterParameterGroup": {
|
||||
output: true,
|
||||
},
|
||||
"ModifyDBParameterGroup": {
|
||||
output: true,
|
||||
},
|
||||
"ResetDBClusterParameterGroup": {
|
||||
output: true,
|
||||
},
|
||||
"ResetDBParameterGroup": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"Redshift": {
|
||||
"DescribeLoggingStatus": {
|
||||
output: true,
|
||||
},
|
||||
"DisableLogging": {
|
||||
output: true,
|
||||
},
|
||||
"EnableLogging": {
|
||||
output: true,
|
||||
},
|
||||
"ModifyClusterParameterGroup": {
|
||||
output: true,
|
||||
},
|
||||
"ResetClusterParameterGroup": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"S3": {
|
||||
"GetBucketNotification": {
|
||||
input: true,
|
||||
output: true,
|
||||
},
|
||||
"GetBucketNotificationConfiguration": {
|
||||
input: true,
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
"SWF": {
|
||||
"CountClosedWorkflowExecutions": {
|
||||
output: true,
|
||||
},
|
||||
"CountOpenWorkflowExecutions": {
|
||||
output: true,
|
||||
},
|
||||
"CountPendingActivityTasks": {
|
||||
output: true,
|
||||
},
|
||||
"CountPendingDecisionTasks": {
|
||||
output: true,
|
||||
},
|
||||
"ListClosedWorkflowExecutions": {
|
||||
output: true,
|
||||
},
|
||||
"ListOpenWorkflowExecutions": {
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
}
|
1
vendor/github.com/aws/aws-sdk-go/private/model/api/load.go
generated
vendored
1
vendor/github.com/aws/aws-sdk-go/private/model/api/load.go
generated
vendored
@ -50,6 +50,7 @@ func (a *API) AttachString(str string) {
|
||||
|
||||
// Setup initializes the API.
|
||||
func (a *API) Setup() {
|
||||
a.setMetadataEndpointsKey()
|
||||
a.writeShapeNames()
|
||||
a.resolveReferences()
|
||||
a.fixStutterNames()
|
||||
|
155
vendor/github.com/aws/aws-sdk-go/private/model/api/operation.go
generated
vendored
155
vendor/github.com/aws/aws-sdk-go/private/model/api/operation.go
generated
vendored
@ -24,6 +24,7 @@ type Operation struct {
|
||||
Paginator *Paginator
|
||||
Deprecated bool `json:"deprecated"`
|
||||
AuthType string `json:"authtype"`
|
||||
imports map[string]bool
|
||||
}
|
||||
|
||||
// A HTTPInfo defines the method of HTTP request for the Operation.
|
||||
@ -43,8 +44,30 @@ func (o *Operation) HasOutput() bool {
|
||||
return o.OutputRef.ShapeName != ""
|
||||
}
|
||||
|
||||
func (o *Operation) GetSigner() string {
|
||||
if o.AuthType == "v4-unsigned-body" {
|
||||
o.API.imports["github.com/aws/aws-sdk-go/aws/signer/v4"] = true
|
||||
}
|
||||
|
||||
buf := bytes.NewBuffer(nil)
|
||||
|
||||
switch o.AuthType {
|
||||
case "none":
|
||||
buf.WriteString("req.Config.Credentials = credentials.AnonymousCredentials")
|
||||
case "v4-unsigned-body":
|
||||
buf.WriteString("req.Handlers.Sign.Remove(v4.SignRequestHandler)\n")
|
||||
buf.WriteString("handler := v4.BuildNamedHandler(\"v4.CustomSignerHandler\", v4.WithUnsignedPayload)\n")
|
||||
buf.WriteString("req.Handlers.Sign.PushFrontNamed(handler)")
|
||||
}
|
||||
|
||||
buf.WriteString("\n")
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
// tplOperation defines a template for rendering an API Operation
|
||||
var tplOperation = template.Must(template.New("operation").Parse(`
|
||||
var tplOperation = template.Must(template.New("operation").Funcs(template.FuncMap{
|
||||
"GetCrosslinkURL": GetCrosslinkURL,
|
||||
}).Parse(`
|
||||
const op{{ .ExportedName }} = "{{ .Name }}"
|
||||
|
||||
// {{ .ExportedName }}Request generates a "aws/request.Request" representing the
|
||||
@ -70,7 +93,11 @@ const op{{ .ExportedName }} = "{{ .Name }}"
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
{{ $crosslinkURL := GetCrosslinkURL $.API.BaseCrosslinkURL $.API.APIName $.API.Metadata.UID $.ExportedName -}}
|
||||
{{ if ne $crosslinkURL "" -}}
|
||||
//
|
||||
// Please also see {{ $crosslinkURL }}
|
||||
{{ end -}}
|
||||
func (c *{{ .API.StructName }}) {{ .ExportedName }}Request(` +
|
||||
`input {{ .InputRef.GoType }}) (req *request.Request, output {{ .OutputRef.GoType }}) {
|
||||
{{ if (or .Deprecated (or .InputRef.Deprecated .OutputRef.Deprecated)) }}if c.Client.Config.Logger != nil {
|
||||
@ -93,12 +120,11 @@ func (c *{{ .API.StructName }}) {{ .ExportedName }}Request(` +
|
||||
input = &{{ .InputRef.GoTypeElem }}{}
|
||||
}
|
||||
|
||||
output = &{{ .OutputRef.GoTypeElem }}{}
|
||||
req = c.newRequest(op, input, output){{ if eq .OutputRef.Shape.Placeholder true }}
|
||||
req.Handlers.Unmarshal.Remove({{ .API.ProtocolPackage }}.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler){{ end }}
|
||||
{{ if eq .AuthType "none" }}req.Config.Credentials = credentials.AnonymousCredentials
|
||||
output = &{{ .OutputRef.GoTypeElem }}{} {{ else }} output = &{{ .OutputRef.GoTypeElem }}{} {{ end }}
|
||||
req.Data = output
|
||||
{{ if ne .AuthType "" }}{{ .GetSigner }}{{ end -}}
|
||||
return
|
||||
}
|
||||
|
||||
@ -118,18 +144,39 @@ func (c *{{ .API.StructName }}) {{ .ExportedName }}Request(` +
|
||||
//
|
||||
// Returned Error Codes:
|
||||
{{ range $_, $err := .ErrorRefs -}}
|
||||
{{ $errDoc := $err.IndentedDocstring -}}
|
||||
// * {{ $err.Shape.ErrorName }}
|
||||
{{ if $errDoc -}}
|
||||
{{ $errDoc }}{{ end }}
|
||||
// * {{ $err.Shape.ErrorCodeName }} "{{ $err.Shape.ErrorName}}"
|
||||
{{ if $err.Docstring -}}
|
||||
{{ $err.IndentedDocstring }}
|
||||
{{ end -}}
|
||||
//
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ $crosslinkURL := GetCrosslinkURL $.API.BaseCrosslinkURL $.API.APIName $.API.Metadata.UID $.ExportedName -}}
|
||||
{{ if ne $crosslinkURL "" -}}
|
||||
// Please also see {{ $crosslinkURL }}
|
||||
{{ end -}}
|
||||
func (c *{{ .API.StructName }}) {{ .ExportedName }}(` +
|
||||
`input {{ .InputRef.GoType }}) ({{ .OutputRef.GoType }}, error) {
|
||||
req, out := c.{{ .ExportedName }}Request(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// {{ .ExportedName }}WithContext is the same as {{ .ExportedName }} with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See {{ .ExportedName }} for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *{{ .API.StructName }}) {{ .ExportedName }}WithContext(` +
|
||||
`ctx aws.Context, input {{ .InputRef.GoType }}, opts ...request.Option) ` +
|
||||
`({{ .OutputRef.GoType }}, error) {
|
||||
req, out := c.{{ .ExportedName }}Request(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
{{ if .Paginator }}
|
||||
@ -151,12 +198,41 @@ func (c *{{ .API.StructName }}) {{ .ExportedName }}(` +
|
||||
// })
|
||||
//
|
||||
func (c *{{ .API.StructName }}) {{ .ExportedName }}Pages(` +
|
||||
`input {{ .InputRef.GoType }}, fn func(p {{ .OutputRef.GoType }}, lastPage bool) (shouldContinue bool)) error {
|
||||
page, _ := c.{{ .ExportedName }}Request(input)
|
||||
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
|
||||
return page.EachPage(func(p interface{}, lastPage bool) bool {
|
||||
return fn(p.({{ .OutputRef.GoType }}), lastPage)
|
||||
})
|
||||
`input {{ .InputRef.GoType }}, fn func({{ .OutputRef.GoType }}, bool) bool) error {
|
||||
return c.{{ .ExportedName }}PagesWithContext(aws.BackgroundContext(), input, fn)
|
||||
}
|
||||
|
||||
// {{ .ExportedName }}PagesWithContext same as {{ .ExportedName }}Pages except
|
||||
// it takes a Context and allows setting request options on the pages.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *{{ .API.StructName }}) {{ .ExportedName }}PagesWithContext(` +
|
||||
`ctx aws.Context, ` +
|
||||
`input {{ .InputRef.GoType }}, ` +
|
||||
`fn func({{ .OutputRef.GoType }}, bool) bool, ` +
|
||||
`opts ...request.Option) error {
|
||||
p := request.Pagination {
|
||||
NewRequest: func() (*request.Request, error) {
|
||||
var inCpy {{ .InputRef.GoType }}
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.{{ .ExportedName }}Request(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
|
||||
cont := true
|
||||
for p.Next() && cont {
|
||||
cont = fn(p.Page().({{ .OutputRef.GoType }}), !p.HasNextPage())
|
||||
}
|
||||
return p.Err()
|
||||
}
|
||||
{{ end }}
|
||||
`))
|
||||
@ -174,12 +250,13 @@ func (o *Operation) GoCode() string {
|
||||
|
||||
// tplInfSig defines the template for rendering an Operation's signature within an Interface definition.
|
||||
var tplInfSig = template.Must(template.New("opsig").Parse(`
|
||||
{{ .ExportedName }}Request({{ .InputRef.GoTypeWithPkgName }}) (*request.Request, {{ .OutputRef.GoTypeWithPkgName }})
|
||||
|
||||
{{ .ExportedName }}({{ .InputRef.GoTypeWithPkgName }}) ({{ .OutputRef.GoTypeWithPkgName }}, error)
|
||||
{{ .ExportedName }}WithContext(aws.Context, {{ .InputRef.GoTypeWithPkgName }}, ...request.Option) ({{ .OutputRef.GoTypeWithPkgName }}, error)
|
||||
{{ .ExportedName }}Request({{ .InputRef.GoTypeWithPkgName }}) (*request.Request, {{ .OutputRef.GoTypeWithPkgName }})
|
||||
|
||||
{{ if .Paginator -}}
|
||||
{{ .ExportedName }}Pages({{ .InputRef.GoTypeWithPkgName }}, func({{ .OutputRef.GoTypeWithPkgName }}, bool) bool) error
|
||||
{{ .ExportedName }}PagesWithContext(aws.Context, {{ .InputRef.GoTypeWithPkgName }}, func({{ .OutputRef.GoTypeWithPkgName }}, bool) bool, ...request.Option) error
|
||||
{{- end }}
|
||||
`))
|
||||
|
||||
@ -198,11 +275,7 @@ func (o *Operation) InterfaceSignature() string {
|
||||
// tplExample defines the template for rendering an Operation example
|
||||
var tplExample = template.Must(template.New("operationExample").Parse(`
|
||||
func Example{{ .API.StructName }}_{{ .ExportedName }}() {
|
||||
sess, err := session.NewSession()
|
||||
if err != nil {
|
||||
fmt.Println("failed to create session,", err)
|
||||
return
|
||||
}
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := {{ .API.PackageName }}.New(sess)
|
||||
|
||||
@ -235,6 +308,10 @@ func (o *Operation) Example() string {
|
||||
// ExampleInput return a string of the rendered Go code for an example's input parameters
|
||||
func (o *Operation) ExampleInput() string {
|
||||
if len(o.InputRef.Shape.MemberRefs) == 0 {
|
||||
if strings.Contains(o.InputRef.GoTypeElem(), ".") {
|
||||
o.imports["github.com/aws/aws-sdk-go/service/"+strings.Split(o.InputRef.GoTypeElem(), ".")[0]] = true
|
||||
return fmt.Sprintf("var params *%s", o.InputRef.GoTypeElem())
|
||||
}
|
||||
return fmt.Sprintf("var params *%s.%s",
|
||||
o.API.PackageName(), o.InputRef.GoTypeElem())
|
||||
}
|
||||
@ -260,6 +337,11 @@ func (e *example) traverseAny(s *Shape, required, payload bool) string {
|
||||
str = e.traverseList(s, required, payload)
|
||||
case "map":
|
||||
str = e.traverseMap(s, required, payload)
|
||||
case "jsonvalue":
|
||||
str = "aws.JSONValue{\"key\": \"value\"}"
|
||||
if required {
|
||||
str += " // Required"
|
||||
}
|
||||
default:
|
||||
str = e.traverseScalar(s, required, payload)
|
||||
}
|
||||
@ -274,7 +356,14 @@ var reType = regexp.MustCompile(`\b([A-Z])`)
|
||||
// traverseStruct returns rendered Go code for a structure type shape.
|
||||
func (e *example) traverseStruct(s *Shape, required, payload bool) string {
|
||||
var buf bytes.Buffer
|
||||
buf.WriteString("&" + s.API.PackageName() + "." + s.GoTypeElem() + "{")
|
||||
|
||||
if s.resolvePkg != "" {
|
||||
e.imports[s.resolvePkg] = true
|
||||
buf.WriteString("&" + s.GoTypeElem() + "{")
|
||||
} else {
|
||||
buf.WriteString("&" + s.API.PackageName() + "." + s.GoTypeElem() + "{")
|
||||
}
|
||||
|
||||
if required {
|
||||
buf.WriteString(" // Required")
|
||||
}
|
||||
@ -314,7 +403,14 @@ func (e *example) traverseStruct(s *Shape, required, payload bool) string {
|
||||
// traverseMap returns rendered Go code for a map type shape.
|
||||
func (e *example) traverseMap(s *Shape, required, payload bool) string {
|
||||
var buf bytes.Buffer
|
||||
t := reType.ReplaceAllString(s.GoTypeElem(), s.API.PackageName()+".$1")
|
||||
|
||||
t := ""
|
||||
if s.resolvePkg != "" {
|
||||
e.imports[s.resolvePkg] = true
|
||||
t = s.GoTypeElem()
|
||||
} else {
|
||||
t = reType.ReplaceAllString(s.GoTypeElem(), s.API.PackageName()+".$1")
|
||||
}
|
||||
buf.WriteString(t + "{")
|
||||
if required {
|
||||
buf.WriteString(" // Required")
|
||||
@ -339,7 +435,14 @@ func (e *example) traverseMap(s *Shape, required, payload bool) string {
|
||||
// traverseList returns rendered Go code for a list type shape.
|
||||
func (e *example) traverseList(s *Shape, required, payload bool) string {
|
||||
var buf bytes.Buffer
|
||||
t := reType.ReplaceAllString(s.GoTypeElem(), s.API.PackageName()+".$1")
|
||||
t := ""
|
||||
if s.resolvePkg != "" {
|
||||
e.imports[s.resolvePkg] = true
|
||||
t = s.GoTypeElem()
|
||||
} else {
|
||||
t = reType.ReplaceAllString(s.GoTypeElem(), s.API.PackageName()+".$1")
|
||||
}
|
||||
|
||||
buf.WriteString(t + "{")
|
||||
if required {
|
||||
buf.WriteString(" // Required")
|
||||
|
2
vendor/github.com/aws/aws-sdk-go/private/model/api/param_filler.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go/private/model/api/param_filler.go
generated
vendored
@ -55,7 +55,7 @@ func (f paramFiller) paramsStructAny(value interface{}, shape *Shape) string {
|
||||
case "blob":
|
||||
v := reflect.Indirect(reflect.ValueOf(value))
|
||||
if v.IsValid() && shape.Streaming {
|
||||
return fmt.Sprintf("aws.ReadSeekCloser(bytes.NewBufferString(%#v))", v.Interface())
|
||||
return fmt.Sprintf("bytes.NewReader([]byte(%#v))", v.Interface())
|
||||
} else if v.IsValid() {
|
||||
return fmt.Sprintf("[]byte(%#v)", v.Interface())
|
||||
}
|
||||
|
53
vendor/github.com/aws/aws-sdk-go/private/model/api/passes.go
generated
vendored
53
vendor/github.com/aws/aws-sdk-go/private/model/api/passes.go
generated
vendored
@ -70,6 +70,14 @@ type referenceResolver struct {
|
||||
visited map[*ShapeRef]bool
|
||||
}
|
||||
|
||||
var jsonvalueShape = &Shape{
|
||||
ShapeName: "JSONValue",
|
||||
Type: "jsonvalue",
|
||||
ValueRef: ShapeRef{
|
||||
JSONValue: true,
|
||||
},
|
||||
}
|
||||
|
||||
// resolveReference updates a shape reference to reference the API and
|
||||
// its shape definition. All other nested references are also resolved.
|
||||
func (r *referenceResolver) resolveReference(ref *ShapeRef) {
|
||||
@ -78,6 +86,11 @@ func (r *referenceResolver) resolveReference(ref *ShapeRef) {
|
||||
}
|
||||
|
||||
if shape, ok := r.API.Shapes[ref.ShapeName]; ok {
|
||||
if ref.JSONValue {
|
||||
ref.ShapeName = "JSONValue"
|
||||
r.API.Shapes[ref.ShapeName] = jsonvalueShape
|
||||
}
|
||||
|
||||
ref.API = r.API // resolve reference back to API
|
||||
ref.Shape = shape // resolve shape reference
|
||||
|
||||
@ -108,18 +121,28 @@ func (r *referenceResolver) resolveShape(shape *Shape) {
|
||||
// exportable variant. The shapes are also updated to include notations
|
||||
// if they are Input or Outputs.
|
||||
func (a *API) renameToplevelShapes() {
|
||||
for _, v := range a.Operations {
|
||||
for _, v := range a.OperationList() {
|
||||
if v.HasInput() {
|
||||
name := v.ExportedName + "Input"
|
||||
switch n := len(v.InputRef.Shape.refs); {
|
||||
case n == 1 && a.Shapes[name] == nil:
|
||||
switch {
|
||||
case a.Shapes[name] == nil:
|
||||
if service, ok := shamelist[a.name]; ok {
|
||||
if check, ok := service[v.Name]; ok && check.input {
|
||||
break
|
||||
}
|
||||
}
|
||||
v.InputRef.Shape.Rename(name)
|
||||
}
|
||||
}
|
||||
if v.HasOutput() {
|
||||
name := v.ExportedName + "Output"
|
||||
switch n := len(v.OutputRef.Shape.refs); {
|
||||
case n == 1 && a.Shapes[name] == nil:
|
||||
switch {
|
||||
case a.Shapes[name] == nil:
|
||||
if service, ok := shamelist[a.name]; ok {
|
||||
if check, ok := service[v.Name]; ok && check.output {
|
||||
break
|
||||
}
|
||||
}
|
||||
v.OutputRef.Shape.Rename(name)
|
||||
}
|
||||
}
|
||||
@ -261,3 +284,23 @@ func (a *API) removeUnusedShapes() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Represents the service package name to EndpointsID mapping
|
||||
var custEndpointsKey = map[string]string{
|
||||
"applicationautoscaling": "application-autoscaling",
|
||||
}
|
||||
|
||||
// Sents the EndpointsID field of Metadata with the value of the
|
||||
// EndpointPrefix if EndpointsID is not set. Also adds
|
||||
// customizations for services if EndpointPrefix is not a valid key.
|
||||
func (a *API) setMetadataEndpointsKey() {
|
||||
if len(a.Metadata.EndpointsID) != 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if v, ok := custEndpointsKey[a.PackageName()]; ok {
|
||||
a.Metadata.EndpointsID = v
|
||||
} else {
|
||||
a.Metadata.EndpointsID = a.Metadata.EndpointPrefix
|
||||
}
|
||||
}
|
||||
|
70
vendor/github.com/aws/aws-sdk-go/private/model/api/shape.go
generated
vendored
70
vendor/github.com/aws/aws-sdk-go/private/model/api/shape.go
generated
vendored
@ -14,20 +14,25 @@ import (
|
||||
|
||||
// A ShapeRef defines the usage of a shape within the API.
|
||||
type ShapeRef struct {
|
||||
API *API `json:"-"`
|
||||
Shape *Shape `json:"-"`
|
||||
Documentation string
|
||||
ShapeName string `json:"shape"`
|
||||
Location string
|
||||
LocationName string
|
||||
QueryName string
|
||||
Flattened bool
|
||||
Streaming bool
|
||||
XMLAttribute bool
|
||||
API *API `json:"-"`
|
||||
Shape *Shape `json:"-"`
|
||||
Documentation string
|
||||
ShapeName string `json:"shape"`
|
||||
Location string
|
||||
LocationName string
|
||||
QueryName string
|
||||
Flattened bool
|
||||
Streaming bool
|
||||
XMLAttribute bool
|
||||
// Ignore, if set, will not be sent over the wire
|
||||
Ignore bool
|
||||
XMLNamespace XMLInfo
|
||||
Payload string
|
||||
IdempotencyToken bool `json:"idempotencyToken"`
|
||||
JSONValue bool `json:"jsonvalue"`
|
||||
Deprecated bool `json:"deprecated"`
|
||||
|
||||
OrigShapeName string `json:"-"`
|
||||
}
|
||||
|
||||
// ErrorInfo represents the error block of a shape's structure
|
||||
@ -69,6 +74,8 @@ type Shape struct {
|
||||
refs []*ShapeRef // References to this shape
|
||||
resolvePkg string // use this package in the goType() if present
|
||||
|
||||
OrigShapeName string `json:"-"`
|
||||
|
||||
// Defines if the shape is a placeholder and should not be used directly
|
||||
Placeholder bool
|
||||
|
||||
@ -81,8 +88,14 @@ type Shape struct {
|
||||
ErrorInfo ErrorInfo `json:"error"`
|
||||
}
|
||||
|
||||
// ErrorCodeName will return the error shape's name formated for
|
||||
// error code const.
|
||||
func (s *Shape) ErrorCodeName() string {
|
||||
return "ErrCode" + s.ShapeName
|
||||
}
|
||||
|
||||
// ErrorName will return the shape's name or error code if available based
|
||||
// on the API's protocol.
|
||||
// on the API's protocol. This is the error code string returned by the service.
|
||||
func (s *Shape) ErrorName() string {
|
||||
name := s.ShapeName
|
||||
switch s.API.Metadata.Protocol {
|
||||
@ -105,10 +118,12 @@ func (s *Shape) GoTags(root, required bool) string {
|
||||
// the associated API's reference to use newName.
|
||||
func (s *Shape) Rename(newName string) {
|
||||
for _, r := range s.refs {
|
||||
r.OrigShapeName = r.ShapeName
|
||||
r.ShapeName = newName
|
||||
}
|
||||
|
||||
delete(s.API.Shapes, s.ShapeName)
|
||||
s.OrigShapeName = s.ShapeName
|
||||
s.API.Shapes[newName] = s
|
||||
s.ShapeName = newName
|
||||
}
|
||||
@ -133,7 +148,7 @@ func (s *Shape) GoTypeWithPkgName() string {
|
||||
// GenAccessors returns if the shape's reference should have setters generated.
|
||||
func (s *ShapeRef) UseIndirection() bool {
|
||||
switch s.Shape.Type {
|
||||
case "map", "list", "blob", "structure":
|
||||
case "map", "list", "blob", "structure", "jsonvalue":
|
||||
return false
|
||||
}
|
||||
|
||||
@ -141,6 +156,10 @@ func (s *ShapeRef) UseIndirection() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if s.JSONValue {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@ -169,6 +188,11 @@ func (s *Shape) GoStructType(name string, ref *ShapeRef) string {
|
||||
return rtype
|
||||
}
|
||||
|
||||
if ref.JSONValue {
|
||||
s.API.imports["github.com/aws/aws-sdk-go/aws"] = true
|
||||
return "aws.JSONValue"
|
||||
}
|
||||
|
||||
for _, v := range s.Validations {
|
||||
// TODO move this to shape validation resolution
|
||||
if (v.Ref.Shape.Type == "map" || v.Ref.Shape.Type == "list") && v.Type == ShapeValidationNested {
|
||||
@ -221,6 +245,8 @@ func goType(s *Shape, withPkgName bool) string {
|
||||
return "*" + s.ShapeName
|
||||
case "map":
|
||||
return "map[string]" + s.ValueRef.GoType()
|
||||
case "jsonvalue":
|
||||
return "aws.JSONValue"
|
||||
case "list":
|
||||
return "[]" + s.MemberRef.GoType()
|
||||
case "boolean":
|
||||
@ -329,6 +355,7 @@ func (ref *ShapeRef) GoTags(toplevel bool, isRequired bool) string {
|
||||
if ref.Deprecated || ref.Shape.Deprecated {
|
||||
tags = append(tags, ShapeTag{"deprecated", "true"})
|
||||
}
|
||||
|
||||
// All shapes have a type
|
||||
tags = append(tags, ShapeTag{"type", ref.Shape.Type})
|
||||
|
||||
@ -381,6 +408,10 @@ func (ref *ShapeRef) GoTags(toplevel bool, isRequired bool) string {
|
||||
tags = append(tags, ShapeTag{"idempotencyToken", "true"})
|
||||
}
|
||||
|
||||
if ref.Ignore {
|
||||
tags = append(tags, ShapeTag{"ignore", "true"})
|
||||
}
|
||||
|
||||
return fmt.Sprintf("`%s`", tags)
|
||||
}
|
||||
|
||||
@ -469,8 +500,21 @@ func (s *Shape) NestedShape() *Shape {
|
||||
return nestedShape
|
||||
}
|
||||
|
||||
var structShapeTmpl = template.Must(template.New("StructShape").Parse(`
|
||||
var structShapeTmpl = template.Must(template.New("StructShape").Funcs(template.FuncMap{
|
||||
"GetCrosslinkURL": GetCrosslinkURL,
|
||||
}).Parse(`
|
||||
{{ .Docstring }}
|
||||
{{ if ne $.OrigShapeName "" -}}
|
||||
{{ $crosslinkURL := GetCrosslinkURL $.API.BaseCrosslinkURL $.API.APIName $.API.Metadata.UID $.OrigShapeName -}}
|
||||
{{ if ne $crosslinkURL "" -}}
|
||||
// Please also see {{ $crosslinkURL }}
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ $crosslinkURL := GetCrosslinkURL $.API.BaseCrosslinkURL $.API.APIName $.API.Metadata.UID $.ShapeName -}}
|
||||
{{ if ne $crosslinkURL "" -}}
|
||||
// Please also see {{ $crosslinkURL }}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ $context := . -}}
|
||||
type {{ .ShapeName }} struct {
|
||||
_ struct{} {{ .GoTags true false }}
|
||||
|
110
vendor/github.com/aws/aws-sdk-go/private/model/api/waiters.go
generated
vendored
110
vendor/github.com/aws/aws-sdk-go/private/model/api/waiters.go
generated
vendored
@ -12,6 +12,25 @@ import (
|
||||
"text/template"
|
||||
)
|
||||
|
||||
// WaiterAcceptor is the acceptors defined in the model the SDK will use
|
||||
// to wait on resource states with.
|
||||
type WaiterAcceptor struct {
|
||||
State string
|
||||
Matcher string
|
||||
Argument string
|
||||
Expected interface{}
|
||||
}
|
||||
|
||||
// ExpectedString returns the string that was expected by the WaiterAcceptor
|
||||
func (a *WaiterAcceptor) ExpectedString() string {
|
||||
switch a.Expected.(type) {
|
||||
case string:
|
||||
return fmt.Sprintf("%q", a.Expected)
|
||||
default:
|
||||
return fmt.Sprintf("%v", a.Expected)
|
||||
}
|
||||
}
|
||||
|
||||
// A Waiter is an individual waiter definition.
|
||||
type Waiter struct {
|
||||
Name string
|
||||
@ -19,23 +38,18 @@ type Waiter struct {
|
||||
MaxAttempts int
|
||||
OperationName string `json:"operation"`
|
||||
Operation *Operation
|
||||
Acceptors []WaitAcceptor
|
||||
}
|
||||
|
||||
// A WaitAcceptor is an individual wait acceptor definition.
|
||||
type WaitAcceptor struct {
|
||||
Expected interface{}
|
||||
Matcher string
|
||||
State string
|
||||
Argument string
|
||||
Acceptors []WaiterAcceptor
|
||||
}
|
||||
|
||||
// WaitersGoCode generates and returns Go code for each of the waiters of
|
||||
// this API.
|
||||
func (a *API) WaitersGoCode() string {
|
||||
var buf bytes.Buffer
|
||||
fmt.Fprintf(&buf, "import (\n\t%q\n)",
|
||||
"github.com/aws/aws-sdk-go/private/waiter")
|
||||
fmt.Fprintf(&buf, "import (\n%q\n\n%q\n%q\n)",
|
||||
"time",
|
||||
"github.com/aws/aws-sdk-go/aws",
|
||||
"github.com/aws/aws-sdk-go/aws/request",
|
||||
)
|
||||
|
||||
for _, w := range a.Waiters {
|
||||
buf.WriteString(w.GoCode())
|
||||
@ -89,53 +103,67 @@ func (p *waiterDefinitions) setup() {
|
||||
}
|
||||
}
|
||||
|
||||
// ExpectedString returns the string that was expected by the WaitAcceptor
|
||||
func (a *WaitAcceptor) ExpectedString() string {
|
||||
switch a.Expected.(type) {
|
||||
case string:
|
||||
return fmt.Sprintf("%q", a.Expected)
|
||||
default:
|
||||
return fmt.Sprintf("%v", a.Expected)
|
||||
}
|
||||
}
|
||||
|
||||
var waiterTmpls = template.Must(template.New("waiterTmpls").Parse(`
|
||||
{{ define "docstring" -}}
|
||||
var waiterTmpls = template.Must(template.New("waiterTmpls").Funcs(
|
||||
template.FuncMap{
|
||||
"titleCase": func(v string) string {
|
||||
return strings.Title(v)
|
||||
},
|
||||
},
|
||||
).Parse(`
|
||||
{{ define "waiter"}}
|
||||
// WaitUntil{{ .Name }} uses the {{ .Operation.API.NiceName }} API operation
|
||||
// {{ .OperationName }} to wait for a condition to be met before returning.
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
{{- end }}
|
||||
|
||||
{{ define "waiter" }}
|
||||
{{ template "docstring" . }}
|
||||
func (c *{{ .Operation.API.StructName }}) WaitUntil{{ .Name }}(input {{ .Operation.InputRef.GoType }}) error {
|
||||
waiterCfg := waiter.Config{
|
||||
Operation: "{{ .OperationName }}",
|
||||
Delay: {{ .Delay }},
|
||||
return c.WaitUntil{{ .Name }}WithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntil{{ .Name }}WithContext is an extended version of WaitUntil{{ .Name }}.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *{{ .Operation.API.StructName }}) WaitUntil{{ .Name }}WithContext(` +
|
||||
`ctx aws.Context, input {{ .Operation.InputRef.GoType }}, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntil{{ .Name }}",
|
||||
MaxAttempts: {{ .MaxAttempts }},
|
||||
Acceptors: []waiter.WaitAcceptor{
|
||||
{{ range $_, $a := .Acceptors }}waiter.WaitAcceptor{
|
||||
State: "{{ .State }}",
|
||||
Matcher: "{{ .Matcher }}",
|
||||
Argument: "{{ .Argument }}",
|
||||
Delay: request.ConstantWaiterDelay({{ .Delay }} * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{{ range $_, $a := .Acceptors }}{
|
||||
State: request.{{ titleCase .State }}WaiterState,
|
||||
Matcher: request.{{ titleCase .Matcher }}WaiterMatch,
|
||||
{{- if .Argument }}Argument: "{{ .Argument }}",{{ end }}
|
||||
Expected: {{ .ExpectedString }},
|
||||
},
|
||||
{{ end }}
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy {{ .Operation.InputRef.GoType }}
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.{{ .OperationName }}Request(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
w := waiter.Waiter{
|
||||
Client: c,
|
||||
Input: input,
|
||||
Config: waiterCfg,
|
||||
}
|
||||
return w.Wait()
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{ define "waiter interface" }}
|
||||
WaitUntil{{ .Name }}({{ .Operation.InputRef.GoTypeWithPkgName }}) error
|
||||
WaitUntil{{ .Name }}WithContext(aws.Context, {{ .Operation.InputRef.GoTypeWithPkgName }}, ...request.WaiterOption) error
|
||||
{{- end }}
|
||||
`))
|
||||
|
||||
|
16
vendor/github.com/aws/aws-sdk-go/private/model/cli/gen-api/main.go
generated
vendored
16
vendor/github.com/aws/aws-sdk-go/private/model/cli/gen-api/main.go
generated
vendored
@ -34,7 +34,7 @@ var excludeServices = map[string]struct{}{
|
||||
// If the SERVICES environment variable is set, and this service is not apart of the list
|
||||
// this service will be skipped.
|
||||
func newGenerateInfo(modelFile, svcPath, svcImportPath string) *generateInfo {
|
||||
g := &generateInfo{API: &api.API{SvcClientImportPath: svcImportPath}}
|
||||
g := &generateInfo{API: &api.API{SvcClientImportPath: svcImportPath, BaseCrosslinkURL: "https://docs.aws.amazon.com"}}
|
||||
g.API.Attach(modelFile)
|
||||
|
||||
if _, ok := excludeServices[g.API.PackageName()]; ok {
|
||||
@ -103,6 +103,7 @@ func main() {
|
||||
flag.StringVar(&sessionPath, "sessionPath", filepath.Join("aws", "session"), "generate session service client factories")
|
||||
flag.StringVar(&svcImportPath, "svc-import-path", "github.com/aws/aws-sdk-go/service", "namespace to generate service client Go code import path under")
|
||||
flag.Parse()
|
||||
api.Bootstrap()
|
||||
|
||||
files := []string{}
|
||||
for i := 0; i < flag.NArg(); i++ {
|
||||
@ -180,6 +181,7 @@ func writeServiceFiles(g *generateInfo, filename string) {
|
||||
Must(writeServiceFile(g))
|
||||
Must(writeInterfaceFile(g))
|
||||
Must(writeWaitersFile(g))
|
||||
Must(writeAPIErrorsFile(g))
|
||||
}
|
||||
|
||||
// Must will panic if the error passed in is not nil.
|
||||
@ -189,7 +191,7 @@ func Must(err error) {
|
||||
}
|
||||
}
|
||||
|
||||
const codeLayout = `// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
const codeLayout = `// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
%s
|
||||
package %s
|
||||
|
||||
@ -260,3 +262,13 @@ func writeAPIFile(g *generateInfo) error {
|
||||
g.API.APIGoCode(),
|
||||
)
|
||||
}
|
||||
|
||||
// writeAPIErrorsFile writes out the service api errors file.
|
||||
func writeAPIErrorsFile(g *generateInfo) error {
|
||||
return writeGoFile(filepath.Join(g.PackageDir, "errors.go"),
|
||||
codeLayout,
|
||||
"",
|
||||
g.API.PackageName(),
|
||||
g.API.APIErrorsGoCode(),
|
||||
)
|
||||
}
|
||||
|
65
vendor/github.com/aws/aws-sdk-go/private/model/cli/gen-endpoints/main.go
generated
vendored
65
vendor/github.com/aws/aws-sdk-go/private/model/cli/gen-endpoints/main.go
generated
vendored
@ -1,49 +1,56 @@
|
||||
// +build codegen
|
||||
|
||||
// Command aws-gen-goendpoints parses a JSON description of the AWS endpoint
|
||||
// Command gen-endpoints parses a JSON description of the AWS endpoint
|
||||
// discovery logic and generates a Go file which returns an endpoint.
|
||||
//
|
||||
// aws-gen-goendpoints apis/_endpoints.json aws/endpoints_map.go
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/aws/aws-sdk-go/private/model"
|
||||
"github.com/aws/aws-sdk-go/aws/endpoints"
|
||||
)
|
||||
|
||||
// Generates the endpoints from json description
|
||||
//
|
||||
// CLI Args:
|
||||
// [0] This file's execution path
|
||||
// [1] The definition file to use
|
||||
// [2] The output file to generate
|
||||
// Args:
|
||||
// -model The definition file to use
|
||||
// -out The output file to generate
|
||||
func main() {
|
||||
in, err := os.Open(os.Args[1])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer in.Close()
|
||||
var modelName, outName string
|
||||
flag.StringVar(&modelName, "model", "", "Endpoints definition model")
|
||||
flag.StringVar(&outName, "out", "", "File to write generated endpoints to.")
|
||||
flag.Parse()
|
||||
|
||||
var endpoints struct {
|
||||
Version int
|
||||
Endpoints map[string]struct {
|
||||
Endpoint string
|
||||
SigningRegion string
|
||||
if len(modelName) == 0 || len(outName) == 0 {
|
||||
exitErrorf("model and out both required.")
|
||||
}
|
||||
|
||||
modelFile, err := os.Open(modelName)
|
||||
if err != nil {
|
||||
exitErrorf("failed to open model definition, %v.", err)
|
||||
}
|
||||
defer modelFile.Close()
|
||||
|
||||
outFile, err := os.Create(outName)
|
||||
if err != nil {
|
||||
exitErrorf("failed to open out file, %v.", err)
|
||||
}
|
||||
defer func() {
|
||||
if err := outFile.Close(); err != nil {
|
||||
exitErrorf("failed to successfully write %q file, %v", outName, err)
|
||||
}
|
||||
}
|
||||
if err = json.NewDecoder(in).Decode(&endpoints); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
|
||||
out, err := os.Create(os.Args[2])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer out.Close()
|
||||
|
||||
if err := model.GenerateEndpoints(endpoints, out); err != nil {
|
||||
panic(err)
|
||||
if err := endpoints.CodeGenModel(modelFile, outFile); err != nil {
|
||||
exitErrorf("failed to codegen model, %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func exitErrorf(msg string, args ...interface{}) {
|
||||
fmt.Fprintf(os.Stderr, msg+"\n", args...)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
59
vendor/github.com/aws/aws-sdk-go/private/model/endpoints.go
generated
vendored
59
vendor/github.com/aws/aws-sdk-go/private/model/endpoints.go
generated
vendored
@ -1,59 +0,0 @@
|
||||
// +build codegen
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"go/format"
|
||||
"io"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
// GenerateEndpoints writes a Go file to the given writer.
|
||||
func GenerateEndpoints(endpoints interface{}, w io.Writer) error {
|
||||
tmpl, err := template.New("endpoints").Parse(t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
out := bytes.NewBuffer(nil)
|
||||
if err = tmpl.Execute(out, endpoints); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
b, err := format.Source(bytes.TrimSpace(out.Bytes()))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = io.Copy(w, bytes.NewReader(b))
|
||||
return err
|
||||
}
|
||||
|
||||
const t = `
|
||||
package endpoints
|
||||
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
type endpointStruct struct {
|
||||
Version int
|
||||
Endpoints map[string]endpointEntry
|
||||
}
|
||||
|
||||
type endpointEntry struct {
|
||||
Endpoint string
|
||||
SigningRegion string
|
||||
}
|
||||
|
||||
var endpointsMap = endpointStruct{
|
||||
Version: {{ .Version }},
|
||||
Endpoints: map[string]endpointEntry{
|
||||
{{ range $key, $entry := .Endpoints }}"{{ $key }}": endpointEntry{
|
||||
Endpoint: "{{ $entry.Endpoint }}",
|
||||
{{ if ne $entry.SigningRegion "" }}SigningRegion: "{{ $entry.SigningRegion }}",
|
||||
{{ end }}
|
||||
},
|
||||
{{ end }}
|
||||
},
|
||||
}
|
||||
`
|
63
vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go
generated
vendored
63
vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go
generated
vendored
@ -4,7 +4,9 @@ package jsonutil
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strconv"
|
||||
@ -25,6 +27,7 @@ func BuildJSON(v interface{}) ([]byte, error) {
|
||||
}
|
||||
|
||||
func buildAny(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {
|
||||
origVal := value
|
||||
value = reflect.Indirect(value)
|
||||
if !value.IsValid() {
|
||||
return nil
|
||||
@ -61,7 +64,7 @@ func buildAny(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) err
|
||||
case "map":
|
||||
return buildMap(value, buf, tag)
|
||||
default:
|
||||
return buildScalar(value, buf, tag)
|
||||
return buildScalar(origVal, buf, tag)
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,6 +90,10 @@ func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag)
|
||||
first := true
|
||||
for i := 0; i < t.NumField(); i++ {
|
||||
member := value.Field(i)
|
||||
|
||||
// This allocates the most memory.
|
||||
// Additionally, we cannot skip nil fields due to
|
||||
// idempotency auto filling.
|
||||
field := t.Field(i)
|
||||
|
||||
if field.PkgPath != "" {
|
||||
@ -98,6 +105,9 @@ func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag)
|
||||
if field.Tag.Get("location") != "" {
|
||||
continue // ignore non-body elements
|
||||
}
|
||||
if field.Tag.Get("ignore") != "" {
|
||||
continue
|
||||
}
|
||||
|
||||
if protocol.CanSetIdempotencyToken(member, field) {
|
||||
token := protocol.GetIdempotencyToken()
|
||||
@ -179,21 +189,32 @@ func buildMap(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) err
|
||||
return nil
|
||||
}
|
||||
|
||||
func buildScalar(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {
|
||||
switch value.Kind() {
|
||||
func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {
|
||||
// prevents allocation on the heap.
|
||||
scratch := [64]byte{}
|
||||
switch value := reflect.Indirect(v); value.Kind() {
|
||||
case reflect.String:
|
||||
writeString(value.String(), buf)
|
||||
case reflect.Bool:
|
||||
buf.WriteString(strconv.FormatBool(value.Bool()))
|
||||
if value.Bool() {
|
||||
buf.WriteString("true")
|
||||
} else {
|
||||
buf.WriteString("false")
|
||||
}
|
||||
case reflect.Int64:
|
||||
buf.WriteString(strconv.FormatInt(value.Int(), 10))
|
||||
buf.Write(strconv.AppendInt(scratch[:0], value.Int(), 10))
|
||||
case reflect.Float64:
|
||||
buf.WriteString(strconv.FormatFloat(value.Float(), 'f', -1, 64))
|
||||
f := value.Float()
|
||||
if math.IsInf(f, 0) || math.IsNaN(f) {
|
||||
return &json.UnsupportedValueError{Value: v, Str: strconv.FormatFloat(f, 'f', -1, 64)}
|
||||
}
|
||||
buf.Write(strconv.AppendFloat(scratch[:0], f, 'f', -1, 64))
|
||||
default:
|
||||
switch value.Type() {
|
||||
case timeType:
|
||||
converted := value.Interface().(time.Time)
|
||||
buf.WriteString(strconv.FormatInt(converted.UTC().Unix(), 10))
|
||||
converted := v.Interface().(*time.Time)
|
||||
|
||||
buf.Write(strconv.AppendInt(scratch[:0], converted.UTC().Unix(), 10))
|
||||
case byteSliceType:
|
||||
if !value.IsNil() {
|
||||
converted := value.Interface().([]byte)
|
||||
@ -219,27 +240,31 @@ func buildScalar(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag)
|
||||
return nil
|
||||
}
|
||||
|
||||
var hex = "0123456789abcdef"
|
||||
|
||||
func writeString(s string, buf *bytes.Buffer) {
|
||||
buf.WriteByte('"')
|
||||
for _, r := range s {
|
||||
if r == '"' {
|
||||
for i := 0; i < len(s); i++ {
|
||||
if s[i] == '"' {
|
||||
buf.WriteString(`\"`)
|
||||
} else if r == '\\' {
|
||||
} else if s[i] == '\\' {
|
||||
buf.WriteString(`\\`)
|
||||
} else if r == '\b' {
|
||||
} else if s[i] == '\b' {
|
||||
buf.WriteString(`\b`)
|
||||
} else if r == '\f' {
|
||||
} else if s[i] == '\f' {
|
||||
buf.WriteString(`\f`)
|
||||
} else if r == '\r' {
|
||||
} else if s[i] == '\r' {
|
||||
buf.WriteString(`\r`)
|
||||
} else if r == '\t' {
|
||||
} else if s[i] == '\t' {
|
||||
buf.WriteString(`\t`)
|
||||
} else if r == '\n' {
|
||||
} else if s[i] == '\n' {
|
||||
buf.WriteString(`\n`)
|
||||
} else if r < 32 {
|
||||
fmt.Fprintf(buf, "\\u%0.4x", r)
|
||||
} else if s[i] < 32 {
|
||||
buf.WriteString("\\u00")
|
||||
buf.WriteByte(hex[s[i]>>4])
|
||||
buf.WriteByte(hex[s[i]&0xF])
|
||||
} else {
|
||||
buf.WriteRune(r)
|
||||
buf.WriteByte(s[i])
|
||||
}
|
||||
}
|
||||
buf.WriteByte('"')
|
||||
|
9
vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
generated
vendored
9
vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
generated
vendored
@ -76,6 +76,9 @@ func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix stri
|
||||
if field.PkgPath != "" {
|
||||
continue // ignore unexported fields
|
||||
}
|
||||
if field.Tag.Get("ignore") != "" {
|
||||
continue
|
||||
}
|
||||
|
||||
if protocol.CanSetIdempotencyToken(value.Field(i), field) {
|
||||
token := protocol.GetIdempotencyToken()
|
||||
@ -120,7 +123,11 @@ func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string
|
||||
|
||||
// check for unflattened list member
|
||||
if !q.isEC2 && tag.Get("flattened") == "" {
|
||||
prefix += ".member"
|
||||
if listName := tag.Get("locationNameList"); listName == "" {
|
||||
prefix += ".member"
|
||||
} else {
|
||||
prefix += "." + listName
|
||||
}
|
||||
}
|
||||
|
||||
for i := 0; i < value.Len(); i++ {
|
||||
|
109
vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go
generated
vendored
109
vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go
generated
vendored
@ -4,6 +4,7 @@ package rest
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@ -47,14 +48,29 @@ var BuildHandler = request.NamedHandler{Name: "awssdk.rest.Build", Fn: Build}
|
||||
func Build(r *request.Request) {
|
||||
if r.ParamsFilled() {
|
||||
v := reflect.ValueOf(r.Params).Elem()
|
||||
buildLocationElements(r, v)
|
||||
buildLocationElements(r, v, false)
|
||||
buildBody(r, v)
|
||||
}
|
||||
}
|
||||
|
||||
func buildLocationElements(r *request.Request, v reflect.Value) {
|
||||
// BuildAsGET builds the REST component of a service request with the ability to hoist
|
||||
// data from the body.
|
||||
func BuildAsGET(r *request.Request) {
|
||||
if r.ParamsFilled() {
|
||||
v := reflect.ValueOf(r.Params).Elem()
|
||||
buildLocationElements(r, v, true)
|
||||
buildBody(r, v)
|
||||
}
|
||||
}
|
||||
|
||||
func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bool) {
|
||||
query := r.HTTPRequest.URL.Query()
|
||||
|
||||
// Setup the raw path to match the base path pattern. This is needed
|
||||
// so that when the path is mutated a custom escaped version can be
|
||||
// stored in RawPath that will be used by the Go client.
|
||||
r.HTTPRequest.URL.RawPath = r.HTTPRequest.URL.Path
|
||||
|
||||
for i := 0; i < v.NumField(); i++ {
|
||||
m := v.Field(i)
|
||||
if n := v.Type().Field(i).Name; n[0:1] == strings.ToLower(n[0:1]) {
|
||||
@ -67,23 +83,34 @@ func buildLocationElements(r *request.Request, v reflect.Value) {
|
||||
if name == "" {
|
||||
name = field.Name
|
||||
}
|
||||
if m.Kind() == reflect.Ptr {
|
||||
if kind := m.Kind(); kind == reflect.Ptr {
|
||||
m = m.Elem()
|
||||
} else if kind == reflect.Interface {
|
||||
if !m.Elem().IsValid() {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if !m.IsValid() {
|
||||
continue
|
||||
}
|
||||
if field.Tag.Get("ignore") != "" {
|
||||
continue
|
||||
}
|
||||
|
||||
var err error
|
||||
switch field.Tag.Get("location") {
|
||||
case "headers": // header maps
|
||||
err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag.Get("locationName"))
|
||||
err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag)
|
||||
case "header":
|
||||
err = buildHeader(&r.HTTPRequest.Header, m, name)
|
||||
err = buildHeader(&r.HTTPRequest.Header, m, name, field.Tag)
|
||||
case "uri":
|
||||
err = buildURI(r.HTTPRequest.URL, m, name)
|
||||
err = buildURI(r.HTTPRequest.URL, m, name, field.Tag)
|
||||
case "querystring":
|
||||
err = buildQueryString(query, m, name)
|
||||
err = buildQueryString(query, m, name, field.Tag)
|
||||
default:
|
||||
if buildGETQuery {
|
||||
err = buildQueryString(query, m, name, field.Tag)
|
||||
}
|
||||
}
|
||||
r.Error = err
|
||||
}
|
||||
@ -93,7 +120,9 @@ func buildLocationElements(r *request.Request, v reflect.Value) {
|
||||
}
|
||||
|
||||
r.HTTPRequest.URL.RawQuery = query.Encode()
|
||||
updatePath(r.HTTPRequest.URL, r.HTTPRequest.URL.Path, aws.BoolValue(r.Config.DisableRestProtocolURICleaning))
|
||||
if !aws.BoolValue(r.Config.DisableRestProtocolURICleaning) {
|
||||
cleanPath(r.HTTPRequest.URL)
|
||||
}
|
||||
}
|
||||
|
||||
func buildBody(r *request.Request, v reflect.Value) {
|
||||
@ -121,8 +150,8 @@ func buildBody(r *request.Request, v reflect.Value) {
|
||||
}
|
||||
}
|
||||
|
||||
func buildHeader(header *http.Header, v reflect.Value, name string) error {
|
||||
str, err := convertType(v)
|
||||
func buildHeader(header *http.Header, v reflect.Value, name string, tag reflect.StructTag) error {
|
||||
str, err := convertType(v, tag)
|
||||
if err == errValueNotSet {
|
||||
return nil
|
||||
} else if err != nil {
|
||||
@ -134,9 +163,10 @@ func buildHeader(header *http.Header, v reflect.Value, name string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error {
|
||||
func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag) error {
|
||||
prefix := tag.Get("locationName")
|
||||
for _, key := range v.MapKeys() {
|
||||
str, err := convertType(v.MapIndex(key))
|
||||
str, err := convertType(v.MapIndex(key), tag)
|
||||
if err == errValueNotSet {
|
||||
continue
|
||||
} else if err != nil {
|
||||
@ -149,23 +179,24 @@ func buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func buildURI(u *url.URL, v reflect.Value, name string) error {
|
||||
value, err := convertType(v)
|
||||
func buildURI(u *url.URL, v reflect.Value, name string, tag reflect.StructTag) error {
|
||||
value, err := convertType(v, tag)
|
||||
if err == errValueNotSet {
|
||||
return nil
|
||||
} else if err != nil {
|
||||
return awserr.New("SerializationError", "failed to encode REST request", err)
|
||||
}
|
||||
|
||||
uri := u.Path
|
||||
uri = strings.Replace(uri, "{"+name+"}", EscapePath(value, true), -1)
|
||||
uri = strings.Replace(uri, "{"+name+"+}", EscapePath(value, false), -1)
|
||||
u.Path = uri
|
||||
u.Path = strings.Replace(u.Path, "{"+name+"}", value, -1)
|
||||
u.Path = strings.Replace(u.Path, "{"+name+"+}", value, -1)
|
||||
|
||||
u.RawPath = strings.Replace(u.RawPath, "{"+name+"}", EscapePath(value, true), -1)
|
||||
u.RawPath = strings.Replace(u.RawPath, "{"+name+"+}", EscapePath(value, false), -1)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func buildQueryString(query url.Values, v reflect.Value, name string) error {
|
||||
func buildQueryString(query url.Values, v reflect.Value, name string, tag reflect.StructTag) error {
|
||||
switch value := v.Interface().(type) {
|
||||
case []*string:
|
||||
for _, item := range value {
|
||||
@ -182,7 +213,7 @@ func buildQueryString(query url.Values, v reflect.Value, name string) error {
|
||||
}
|
||||
}
|
||||
default:
|
||||
str, err := convertType(v)
|
||||
str, err := convertType(v, tag)
|
||||
if err == errValueNotSet {
|
||||
return nil
|
||||
} else if err != nil {
|
||||
@ -194,27 +225,17 @@ func buildQueryString(query url.Values, v reflect.Value, name string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func updatePath(url *url.URL, urlPath string, disableRestProtocolURICleaning bool) {
|
||||
scheme, query := url.Scheme, url.RawQuery
|
||||
func cleanPath(u *url.URL) {
|
||||
hasSlash := strings.HasSuffix(u.Path, "/")
|
||||
|
||||
hasSlash := strings.HasSuffix(urlPath, "/")
|
||||
// clean up path, removing duplicate `/`
|
||||
u.Path = path.Clean(u.Path)
|
||||
u.RawPath = path.Clean(u.RawPath)
|
||||
|
||||
// clean up path
|
||||
if !disableRestProtocolURICleaning {
|
||||
urlPath = path.Clean(urlPath)
|
||||
if hasSlash && !strings.HasSuffix(u.Path, "/") {
|
||||
u.Path += "/"
|
||||
u.RawPath += "/"
|
||||
}
|
||||
if hasSlash && !strings.HasSuffix(urlPath, "/") {
|
||||
urlPath += "/"
|
||||
}
|
||||
|
||||
// get formatted URL minus scheme so we can build this into Opaque
|
||||
url.Scheme, url.Path, url.RawQuery = "", "", ""
|
||||
s := url.String()
|
||||
url.Scheme = scheme
|
||||
url.RawQuery = query
|
||||
|
||||
// build opaque URI
|
||||
url.Opaque = s + urlPath
|
||||
}
|
||||
|
||||
// EscapePath escapes part of a URL path in Amazon style
|
||||
@ -231,7 +252,7 @@ func EscapePath(path string, encodeSep bool) string {
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
func convertType(v reflect.Value) (string, error) {
|
||||
func convertType(v reflect.Value, tag reflect.StructTag) (string, error) {
|
||||
v = reflect.Indirect(v)
|
||||
if !v.IsValid() {
|
||||
return "", errValueNotSet
|
||||
@ -251,6 +272,16 @@ func convertType(v reflect.Value) (string, error) {
|
||||
str = strconv.FormatFloat(value, 'f', -1, 64)
|
||||
case time.Time:
|
||||
str = value.UTC().Format(RFC822)
|
||||
case aws.JSONValue:
|
||||
b, err := json.Marshal(value)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if tag.Get("location") == "header" {
|
||||
str = base64.StdEncoding.EncodeToString(b)
|
||||
} else {
|
||||
str = string(b)
|
||||
}
|
||||
default:
|
||||
err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type())
|
||||
return "", err
|
||||
|
41
vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
generated
vendored
41
vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
generated
vendored
@ -1,7 +1,9 @@
|
||||
package rest
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@ -70,10 +72,16 @@ func unmarshalBody(r *request.Request, v reflect.Value) {
|
||||
}
|
||||
default:
|
||||
switch payload.Type().String() {
|
||||
case "io.ReadSeeker":
|
||||
payload.Set(reflect.ValueOf(aws.ReadSeekCloser(r.HTTPResponse.Body)))
|
||||
case "aws.ReadSeekCloser", "io.ReadCloser":
|
||||
case "io.ReadCloser":
|
||||
payload.Set(reflect.ValueOf(r.HTTPResponse.Body))
|
||||
case "io.ReadSeeker":
|
||||
b, err := ioutil.ReadAll(r.HTTPResponse.Body)
|
||||
if err != nil {
|
||||
r.Error = awserr.New("SerializationError",
|
||||
"failed to read response body", err)
|
||||
return
|
||||
}
|
||||
payload.Set(reflect.ValueOf(ioutil.NopCloser(bytes.NewReader(b))))
|
||||
default:
|
||||
io.Copy(ioutil.Discard, r.HTTPResponse.Body)
|
||||
defer r.HTTPResponse.Body.Close()
|
||||
@ -105,7 +113,7 @@ func unmarshalLocationElements(r *request.Request, v reflect.Value) {
|
||||
case "statusCode":
|
||||
unmarshalStatusCode(m, r.HTTPResponse.StatusCode)
|
||||
case "header":
|
||||
err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name))
|
||||
err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name), field.Tag)
|
||||
if err != nil {
|
||||
r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
|
||||
break
|
||||
@ -152,8 +160,13 @@ func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) err
|
||||
return nil
|
||||
}
|
||||
|
||||
func unmarshalHeader(v reflect.Value, header string) error {
|
||||
if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) {
|
||||
func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) error {
|
||||
isJSONValue := tag.Get("type") == "jsonvalue"
|
||||
if isJSONValue {
|
||||
if len(header) == 0 {
|
||||
return nil
|
||||
}
|
||||
} else if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -190,6 +203,22 @@ func unmarshalHeader(v reflect.Value, header string) error {
|
||||
return err
|
||||
}
|
||||
v.Set(reflect.ValueOf(&t))
|
||||
case aws.JSONValue:
|
||||
b := []byte(header)
|
||||
var err error
|
||||
if tag.Get("location") == "header" {
|
||||
b, err = base64.StdEncoding.DecodeString(header)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
m := aws.JSONValue{}
|
||||
err = json.Unmarshal(b, &m)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
v.Set(reflect.ValueOf(m))
|
||||
default:
|
||||
err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type())
|
||||
return err
|
||||
|
4
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go
generated
vendored
4
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go
generated
vendored
@ -127,6 +127,10 @@ func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag refl
|
||||
if field.PkgPath != "" {
|
||||
continue // ignore unexported fields
|
||||
}
|
||||
if field.Tag.Get("ignore") != "" {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
mTag := field.Tag
|
||||
if mTag.Get("location") != "" { // skip non-body members
|
||||
|
7
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go
generated
vendored
7
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go
generated
vendored
@ -111,11 +111,8 @@ func parseStruct(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
|
||||
elems := node.Children[name]
|
||||
|
||||
if elems == nil { // try to find the field in attributes
|
||||
for _, a := range node.Attr {
|
||||
if name == a.Name.Local {
|
||||
// turn this into a text node for de-serializing
|
||||
elems = []*XMLNode{{Text: a.Value}}
|
||||
}
|
||||
if val, ok := node.findElem(name); ok {
|
||||
elems = []*XMLNode{{Text: val}}
|
||||
}
|
||||
}
|
||||
|
||||
|
37
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go
generated
vendored
37
vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go
generated
vendored
@ -2,6 +2,7 @@ package xmlutil
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"io"
|
||||
"sort"
|
||||
)
|
||||
@ -12,6 +13,9 @@ type XMLNode struct {
|
||||
Children map[string][]*XMLNode `json:",omitempty"`
|
||||
Text string `json:",omitempty"`
|
||||
Attr []xml.Attr `json:",omitempty"`
|
||||
|
||||
namespaces map[string]string
|
||||
parent *XMLNode
|
||||
}
|
||||
|
||||
// NewXMLElement returns a pointer to a new XMLNode initialized to default values.
|
||||
@ -59,21 +63,54 @@ func XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error) {
|
||||
slice = []*XMLNode{}
|
||||
}
|
||||
node, e := XMLToStruct(d, &el)
|
||||
out.findNamespaces()
|
||||
if e != nil {
|
||||
return out, e
|
||||
}
|
||||
node.Name = typed.Name
|
||||
node.findNamespaces()
|
||||
tempOut := *out
|
||||
// Save into a temp variable, simply because out gets squashed during
|
||||
// loop iterations
|
||||
node.parent = &tempOut
|
||||
slice = append(slice, node)
|
||||
out.Children[name] = slice
|
||||
case xml.EndElement:
|
||||
if s != nil && s.Name.Local == typed.Name.Local { // matching end token
|
||||
return out, nil
|
||||
}
|
||||
out = &XMLNode{}
|
||||
}
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (n *XMLNode) findNamespaces() {
|
||||
ns := map[string]string{}
|
||||
for _, a := range n.Attr {
|
||||
if a.Name.Space == "xmlns" {
|
||||
ns[a.Value] = a.Name.Local
|
||||
}
|
||||
}
|
||||
|
||||
n.namespaces = ns
|
||||
}
|
||||
|
||||
func (n *XMLNode) findElem(name string) (string, bool) {
|
||||
for node := n; node != nil; node = node.parent {
|
||||
for _, a := range node.Attr {
|
||||
namespace := a.Name.Space
|
||||
if v, ok := node.namespaces[namespace]; ok {
|
||||
namespace = v
|
||||
}
|
||||
if name == fmt.Sprintf("%s:%s", namespace, a.Name.Local) {
|
||||
return a.Value, true
|
||||
}
|
||||
}
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
// StructToXML writes an XMLNode to a xml.Encoder as tokens.
|
||||
func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error {
|
||||
e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr})
|
||||
|
134
vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go
generated
vendored
134
vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go
generated
vendored
@ -1,134 +0,0 @@
|
||||
package waiter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/awsutil"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// A Config provides a collection of configuration values to setup a generated
|
||||
// waiter code with.
|
||||
type Config struct {
|
||||
Name string
|
||||
Delay int
|
||||
MaxAttempts int
|
||||
Operation string
|
||||
Acceptors []WaitAcceptor
|
||||
}
|
||||
|
||||
// A WaitAcceptor provides the information needed to wait for an API operation
|
||||
// to complete.
|
||||
type WaitAcceptor struct {
|
||||
Expected interface{}
|
||||
Matcher string
|
||||
State string
|
||||
Argument string
|
||||
}
|
||||
|
||||
// A Waiter provides waiting for an operation to complete.
|
||||
type Waiter struct {
|
||||
Config
|
||||
Client interface{}
|
||||
Input interface{}
|
||||
}
|
||||
|
||||
// Wait waits for an operation to complete, expire max attempts, or fail. Error
|
||||
// is returned if the operation fails.
|
||||
func (w *Waiter) Wait() error {
|
||||
client := reflect.ValueOf(w.Client)
|
||||
in := reflect.ValueOf(w.Input)
|
||||
method := client.MethodByName(w.Config.Operation + "Request")
|
||||
|
||||
for i := 0; i < w.MaxAttempts; i++ {
|
||||
res := method.Call([]reflect.Value{in})
|
||||
req := res[0].Interface().(*request.Request)
|
||||
req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Waiter"))
|
||||
|
||||
err := req.Send()
|
||||
for _, a := range w.Acceptors {
|
||||
result := false
|
||||
var vals []interface{}
|
||||
switch a.Matcher {
|
||||
case "pathAll", "path":
|
||||
// Require all matches to be equal for result to match
|
||||
vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
|
||||
if len(vals) == 0 {
|
||||
break
|
||||
}
|
||||
result = true
|
||||
for _, val := range vals {
|
||||
if !awsutil.DeepEqual(val, a.Expected) {
|
||||
result = false
|
||||
break
|
||||
}
|
||||
}
|
||||
case "pathAny":
|
||||
// Only a single match needs to equal for the result to match
|
||||
vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
|
||||
for _, val := range vals {
|
||||
if awsutil.DeepEqual(val, a.Expected) {
|
||||
result = true
|
||||
break
|
||||
}
|
||||
}
|
||||
case "status":
|
||||
s := a.Expected.(int)
|
||||
result = s == req.HTTPResponse.StatusCode
|
||||
case "error":
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
result = aerr.Code() == a.Expected.(string)
|
||||
}
|
||||
case "pathList":
|
||||
// ignored matcher
|
||||
default:
|
||||
logf(client, "WARNING: Waiter for %s encountered unexpected matcher: %s",
|
||||
w.Config.Operation, a.Matcher)
|
||||
}
|
||||
|
||||
if !result {
|
||||
// If there was no matching result found there is nothing more to do
|
||||
// for this response, retry the request.
|
||||
continue
|
||||
}
|
||||
|
||||
switch a.State {
|
||||
case "success":
|
||||
// waiter completed
|
||||
return nil
|
||||
case "failure":
|
||||
// Waiter failure state triggered
|
||||
return awserr.New("ResourceNotReady",
|
||||
fmt.Sprintf("failed waiting for successful resource state"), err)
|
||||
case "retry":
|
||||
// clear the error and retry the operation
|
||||
err = nil
|
||||
default:
|
||||
logf(client, "WARNING: Waiter for %s encountered unexpected state: %s",
|
||||
w.Config.Operation, a.State)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
time.Sleep(time.Second * time.Duration(w.Delay))
|
||||
}
|
||||
|
||||
return awserr.New("ResourceNotReady",
|
||||
fmt.Sprintf("exceeded %d wait attempts", w.MaxAttempts), nil)
|
||||
}
|
||||
|
||||
func logf(client reflect.Value, msg string, args ...interface{}) {
|
||||
cfgVal := client.FieldByName("Config")
|
||||
if !cfgVal.IsValid() {
|
||||
return
|
||||
}
|
||||
if cfg, ok := cfgVal.Interface().(*aws.Config); ok && cfg.Logger != nil {
|
||||
cfg.Logger.Log(fmt.Sprintf(msg, args...))
|
||||
}
|
||||
}
|
528
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go
generated
vendored
528
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go
generated
vendored
File diff suppressed because it is too large
Load Diff
106
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go
generated
vendored
106
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go
generated
vendored
@ -1,64 +1,120 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package cloudwatchiface provides an interface for the Amazon CloudWatch.
|
||||
// Package cloudwatchiface provides an interface to enable mocking the Amazon CloudWatch service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package cloudwatchiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/cloudwatch"
|
||||
)
|
||||
|
||||
// CloudWatchAPI is the interface type for cloudwatch.CloudWatch.
|
||||
// CloudWatchAPI provides an interface to enable mocking the
|
||||
// cloudwatch.CloudWatch service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Amazon CloudWatch.
|
||||
// func myFunc(svc cloudwatchiface.CloudWatchAPI) bool {
|
||||
// // Make svc.DeleteAlarms request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := cloudwatch.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockCloudWatchClient struct {
|
||||
// cloudwatchiface.CloudWatchAPI
|
||||
// }
|
||||
// func (m *mockCloudWatchClient) DeleteAlarms(input *cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockCloudWatchClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type CloudWatchAPI interface {
|
||||
DeleteAlarms(*cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error)
|
||||
DeleteAlarmsWithContext(aws.Context, *cloudwatch.DeleteAlarmsInput, ...request.Option) (*cloudwatch.DeleteAlarmsOutput, error)
|
||||
DeleteAlarmsRequest(*cloudwatch.DeleteAlarmsInput) (*request.Request, *cloudwatch.DeleteAlarmsOutput)
|
||||
|
||||
DeleteAlarms(*cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error)
|
||||
|
||||
DescribeAlarmHistory(*cloudwatch.DescribeAlarmHistoryInput) (*cloudwatch.DescribeAlarmHistoryOutput, error)
|
||||
DescribeAlarmHistoryWithContext(aws.Context, *cloudwatch.DescribeAlarmHistoryInput, ...request.Option) (*cloudwatch.DescribeAlarmHistoryOutput, error)
|
||||
DescribeAlarmHistoryRequest(*cloudwatch.DescribeAlarmHistoryInput) (*request.Request, *cloudwatch.DescribeAlarmHistoryOutput)
|
||||
|
||||
DescribeAlarmHistory(*cloudwatch.DescribeAlarmHistoryInput) (*cloudwatch.DescribeAlarmHistoryOutput, error)
|
||||
|
||||
DescribeAlarmHistoryPages(*cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool) error
|
||||
|
||||
DescribeAlarmsRequest(*cloudwatch.DescribeAlarmsInput) (*request.Request, *cloudwatch.DescribeAlarmsOutput)
|
||||
DescribeAlarmHistoryPagesWithContext(aws.Context, *cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeAlarms(*cloudwatch.DescribeAlarmsInput) (*cloudwatch.DescribeAlarmsOutput, error)
|
||||
DescribeAlarmsWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, ...request.Option) (*cloudwatch.DescribeAlarmsOutput, error)
|
||||
DescribeAlarmsRequest(*cloudwatch.DescribeAlarmsInput) (*request.Request, *cloudwatch.DescribeAlarmsOutput)
|
||||
|
||||
DescribeAlarmsPages(*cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool) error
|
||||
|
||||
DescribeAlarmsForMetricRequest(*cloudwatch.DescribeAlarmsForMetricInput) (*request.Request, *cloudwatch.DescribeAlarmsForMetricOutput)
|
||||
DescribeAlarmsPagesWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeAlarmsForMetric(*cloudwatch.DescribeAlarmsForMetricInput) (*cloudwatch.DescribeAlarmsForMetricOutput, error)
|
||||
|
||||
DisableAlarmActionsRequest(*cloudwatch.DisableAlarmActionsInput) (*request.Request, *cloudwatch.DisableAlarmActionsOutput)
|
||||
DescribeAlarmsForMetricWithContext(aws.Context, *cloudwatch.DescribeAlarmsForMetricInput, ...request.Option) (*cloudwatch.DescribeAlarmsForMetricOutput, error)
|
||||
DescribeAlarmsForMetricRequest(*cloudwatch.DescribeAlarmsForMetricInput) (*request.Request, *cloudwatch.DescribeAlarmsForMetricOutput)
|
||||
|
||||
DisableAlarmActions(*cloudwatch.DisableAlarmActionsInput) (*cloudwatch.DisableAlarmActionsOutput, error)
|
||||
|
||||
EnableAlarmActionsRequest(*cloudwatch.EnableAlarmActionsInput) (*request.Request, *cloudwatch.EnableAlarmActionsOutput)
|
||||
DisableAlarmActionsWithContext(aws.Context, *cloudwatch.DisableAlarmActionsInput, ...request.Option) (*cloudwatch.DisableAlarmActionsOutput, error)
|
||||
DisableAlarmActionsRequest(*cloudwatch.DisableAlarmActionsInput) (*request.Request, *cloudwatch.DisableAlarmActionsOutput)
|
||||
|
||||
EnableAlarmActions(*cloudwatch.EnableAlarmActionsInput) (*cloudwatch.EnableAlarmActionsOutput, error)
|
||||
|
||||
GetMetricStatisticsRequest(*cloudwatch.GetMetricStatisticsInput) (*request.Request, *cloudwatch.GetMetricStatisticsOutput)
|
||||
EnableAlarmActionsWithContext(aws.Context, *cloudwatch.EnableAlarmActionsInput, ...request.Option) (*cloudwatch.EnableAlarmActionsOutput, error)
|
||||
EnableAlarmActionsRequest(*cloudwatch.EnableAlarmActionsInput) (*request.Request, *cloudwatch.EnableAlarmActionsOutput)
|
||||
|
||||
GetMetricStatistics(*cloudwatch.GetMetricStatisticsInput) (*cloudwatch.GetMetricStatisticsOutput, error)
|
||||
|
||||
ListMetricsRequest(*cloudwatch.ListMetricsInput) (*request.Request, *cloudwatch.ListMetricsOutput)
|
||||
GetMetricStatisticsWithContext(aws.Context, *cloudwatch.GetMetricStatisticsInput, ...request.Option) (*cloudwatch.GetMetricStatisticsOutput, error)
|
||||
GetMetricStatisticsRequest(*cloudwatch.GetMetricStatisticsInput) (*request.Request, *cloudwatch.GetMetricStatisticsOutput)
|
||||
|
||||
ListMetrics(*cloudwatch.ListMetricsInput) (*cloudwatch.ListMetricsOutput, error)
|
||||
ListMetricsWithContext(aws.Context, *cloudwatch.ListMetricsInput, ...request.Option) (*cloudwatch.ListMetricsOutput, error)
|
||||
ListMetricsRequest(*cloudwatch.ListMetricsInput) (*request.Request, *cloudwatch.ListMetricsOutput)
|
||||
|
||||
ListMetricsPages(*cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool) error
|
||||
|
||||
PutMetricAlarmRequest(*cloudwatch.PutMetricAlarmInput) (*request.Request, *cloudwatch.PutMetricAlarmOutput)
|
||||
ListMetricsPagesWithContext(aws.Context, *cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
PutMetricAlarm(*cloudwatch.PutMetricAlarmInput) (*cloudwatch.PutMetricAlarmOutput, error)
|
||||
|
||||
PutMetricDataRequest(*cloudwatch.PutMetricDataInput) (*request.Request, *cloudwatch.PutMetricDataOutput)
|
||||
PutMetricAlarmWithContext(aws.Context, *cloudwatch.PutMetricAlarmInput, ...request.Option) (*cloudwatch.PutMetricAlarmOutput, error)
|
||||
PutMetricAlarmRequest(*cloudwatch.PutMetricAlarmInput) (*request.Request, *cloudwatch.PutMetricAlarmOutput)
|
||||
|
||||
PutMetricData(*cloudwatch.PutMetricDataInput) (*cloudwatch.PutMetricDataOutput, error)
|
||||
|
||||
SetAlarmStateRequest(*cloudwatch.SetAlarmStateInput) (*request.Request, *cloudwatch.SetAlarmStateOutput)
|
||||
PutMetricDataWithContext(aws.Context, *cloudwatch.PutMetricDataInput, ...request.Option) (*cloudwatch.PutMetricDataOutput, error)
|
||||
PutMetricDataRequest(*cloudwatch.PutMetricDataInput) (*request.Request, *cloudwatch.PutMetricDataOutput)
|
||||
|
||||
SetAlarmState(*cloudwatch.SetAlarmStateInput) (*cloudwatch.SetAlarmStateOutput, error)
|
||||
SetAlarmStateWithContext(aws.Context, *cloudwatch.SetAlarmStateInput, ...request.Option) (*cloudwatch.SetAlarmStateOutput, error)
|
||||
SetAlarmStateRequest(*cloudwatch.SetAlarmStateInput) (*request.Request, *cloudwatch.SetAlarmStateOutput)
|
||||
|
||||
WaitUntilAlarmExists(*cloudwatch.DescribeAlarmsInput) error
|
||||
WaitUntilAlarmExistsWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, ...request.WaiterOption) error
|
||||
}
|
||||
|
||||
var _ CloudWatchAPI = (*cloudwatch.CloudWatch)(nil)
|
||||
|
54
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go
generated
vendored
Normal file
54
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeInternalServiceFault for service response error code
|
||||
// "InternalServiceError".
|
||||
//
|
||||
// Request processing has failed due to some unknown error, exception, or failure.
|
||||
ErrCodeInternalServiceFault = "InternalServiceError"
|
||||
|
||||
// ErrCodeInvalidFormatFault for service response error code
|
||||
// "InvalidFormat".
|
||||
//
|
||||
// Data was not syntactically valid JSON.
|
||||
ErrCodeInvalidFormatFault = "InvalidFormat"
|
||||
|
||||
// ErrCodeInvalidNextToken for service response error code
|
||||
// "InvalidNextToken".
|
||||
//
|
||||
// The next token specified is invalid.
|
||||
ErrCodeInvalidNextToken = "InvalidNextToken"
|
||||
|
||||
// ErrCodeInvalidParameterCombinationException for service response error code
|
||||
// "InvalidParameterCombination".
|
||||
//
|
||||
// Parameters that cannot be used together were used together.
|
||||
ErrCodeInvalidParameterCombinationException = "InvalidParameterCombination"
|
||||
|
||||
// ErrCodeInvalidParameterValueException for service response error code
|
||||
// "InvalidParameterValue".
|
||||
//
|
||||
// The value of an input parameter is bad or out-of-range.
|
||||
ErrCodeInvalidParameterValueException = "InvalidParameterValue"
|
||||
|
||||
// ErrCodeLimitExceededFault for service response error code
|
||||
// "LimitExceeded".
|
||||
//
|
||||
// The quota for alarms for this customer has already been reached.
|
||||
ErrCodeLimitExceededFault = "LimitExceeded"
|
||||
|
||||
// ErrCodeMissingRequiredParameterException for service response error code
|
||||
// "MissingParameter".
|
||||
//
|
||||
// An input parameter that is required is missing.
|
||||
ErrCodeMissingRequiredParameterException = "MissingParameter"
|
||||
|
||||
// ErrCodeResourceNotFound for service response error code
|
||||
// "ResourceNotFound".
|
||||
//
|
||||
// The named resource does not exist.
|
||||
ErrCodeResourceNotFound = "ResourceNotFound"
|
||||
)
|
19
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go
generated
vendored
19
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch
|
||||
|
||||
@ -26,8 +26,9 @@ import (
|
||||
// In addition to monitoring the built-in metrics that come with AWS, you can
|
||||
// monitor your own custom metrics. With CloudWatch, you gain system-wide visibility
|
||||
// into resource utilization, application performance, and operational health.
|
||||
//The service client's operations are safe to be used concurrently.
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01
|
||||
type CloudWatch struct {
|
||||
*client.Client
|
||||
}
|
||||
@ -38,8 +39,11 @@ var initClient func(*client.Client)
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// A ServiceName is the name of the service the client will make API calls to.
|
||||
const ServiceName = "monitoring"
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "monitoring" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the CloudWatch client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
@ -52,17 +56,18 @@ const ServiceName = "monitoring"
|
||||
// // Create a CloudWatch client with additional configuration
|
||||
// svc := cloudwatch.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudWatch {
|
||||
c := p.ClientConfig(ServiceName, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *CloudWatch {
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudWatch {
|
||||
svc := &CloudWatch{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2010-08-01",
|
||||
|
52
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go
generated
vendored
52
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go
generated
vendored
@ -1,9 +1,12 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/private/waiter"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// WaitUntilAlarmExists uses the CloudWatch API operation
|
||||
@ -11,24 +14,43 @@ import (
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
func (c *CloudWatch) WaitUntilAlarmExists(input *DescribeAlarmsInput) error {
|
||||
waiterCfg := waiter.Config{
|
||||
Operation: "DescribeAlarms",
|
||||
Delay: 5,
|
||||
return c.WaitUntilAlarmExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilAlarmExistsWithContext is an extended version of WaitUntilAlarmExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *CloudWatch) WaitUntilAlarmExistsWithContext(ctx aws.Context, input *DescribeAlarmsInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilAlarmExists",
|
||||
MaxAttempts: 40,
|
||||
Acceptors: []waiter.WaitAcceptor{
|
||||
Delay: request.ConstantWaiterDelay(5 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: "success",
|
||||
Matcher: "path",
|
||||
Argument: "length(MetricAlarms[]) > `0`",
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "length(MetricAlarms[]) > `0`",
|
||||
Expected: true,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeAlarmsInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeAlarmsRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
w := waiter.Waiter{
|
||||
Client: c,
|
||||
Input: input,
|
||||
Config: waiterCfg,
|
||||
}
|
||||
return w.Wait()
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
10587
vendor/github.com/aws/aws-sdk-go/service/ec2/api.go
generated
vendored
10587
vendor/github.com/aws/aws-sdk-go/service/ec2/api.go
generated
vendored
File diff suppressed because it is too large
Load Diff
20
vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go
generated
vendored
20
vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go
generated
vendored
@ -5,8 +5,8 @@ import (
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awsutil"
|
||||
"github.com/aws/aws-sdk-go/aws/endpoints"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/private/endpoints"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -39,12 +39,20 @@ func fillPresignedURL(r *request.Request) {
|
||||
WithRegion(aws.StringValue(origParams.SourceRegion)))
|
||||
|
||||
clientInfo := r.ClientInfo
|
||||
clientInfo.Endpoint, clientInfo.SigningRegion = endpoints.EndpointForRegion(
|
||||
clientInfo.ServiceName,
|
||||
aws.StringValue(cfg.Region),
|
||||
aws.BoolValue(cfg.DisableSSL),
|
||||
aws.BoolValue(cfg.UseDualStack),
|
||||
resolved, err := r.Config.EndpointResolver.EndpointFor(
|
||||
clientInfo.ServiceName, aws.StringValue(cfg.Region),
|
||||
func(opt *endpoints.Options) {
|
||||
opt.DisableSSL = aws.BoolValue(cfg.DisableSSL)
|
||||
opt.UseDualStack = aws.BoolValue(cfg.UseDualStack)
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
r.Error = err
|
||||
return
|
||||
}
|
||||
|
||||
clientInfo.Endpoint = resolved.URL
|
||||
clientInfo.SigningRegion = resolved.SigningRegion
|
||||
|
||||
// Presign a CopySnapshot request with modified params
|
||||
req := request.New(*cfg, clientInfo, r.Handlers, r.Retryer, r.Operation, newParams, r.Data)
|
||||
|
1032
vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go
generated
vendored
1032
vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go
generated
vendored
File diff suppressed because it is too large
Load Diff
3
vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go
generated
vendored
Normal file
3
vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package ec2
|
21
vendor/github.com/aws/aws-sdk-go/service/ec2/service.go
generated
vendored
21
vendor/github.com/aws/aws-sdk-go/service/ec2/service.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package ec2
|
||||
|
||||
@ -15,8 +15,9 @@ import (
|
||||
// in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your
|
||||
// need to invest in hardware up front, so you can develop and deploy applications
|
||||
// faster.
|
||||
//The service client's operations are safe to be used concurrently.
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15
|
||||
type EC2 struct {
|
||||
*client.Client
|
||||
}
|
||||
@ -27,8 +28,11 @@ var initClient func(*client.Client)
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// A ServiceName is the name of the service the client will make API calls to.
|
||||
const ServiceName = "ec2"
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "ec2" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the EC2 client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
@ -41,20 +45,21 @@ const ServiceName = "ec2"
|
||||
// // Create a EC2 client with additional configuration
|
||||
// svc := ec2.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2 {
|
||||
c := p.ClientConfig(ServiceName, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *EC2 {
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *EC2 {
|
||||
svc := &EC2{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2016-09-15",
|
||||
APIVersion: "2016-11-15",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
|
1581
vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go
generated
vendored
1581
vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go
generated
vendored
File diff suppressed because it is too large
Load Diff
5454
vendor/github.com/aws/aws-sdk-go/service/s3/api.go
generated
vendored
5454
vendor/github.com/aws/aws-sdk-go/service/s3/api.go
generated
vendored
File diff suppressed because it is too large
Load Diff
48
vendor/github.com/aws/aws-sdk-go/service/s3/errors.go
generated
vendored
Normal file
48
vendor/github.com/aws/aws-sdk-go/service/s3/errors.go
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package s3
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeBucketAlreadyExists for service response error code
|
||||
// "BucketAlreadyExists".
|
||||
//
|
||||
// The requested bucket name is not available. The bucket namespace is shared
|
||||
// by all users of the system. Please select a different name and try again.
|
||||
ErrCodeBucketAlreadyExists = "BucketAlreadyExists"
|
||||
|
||||
// ErrCodeBucketAlreadyOwnedByYou for service response error code
|
||||
// "BucketAlreadyOwnedByYou".
|
||||
ErrCodeBucketAlreadyOwnedByYou = "BucketAlreadyOwnedByYou"
|
||||
|
||||
// ErrCodeNoSuchBucket for service response error code
|
||||
// "NoSuchBucket".
|
||||
//
|
||||
// The specified bucket does not exist.
|
||||
ErrCodeNoSuchBucket = "NoSuchBucket"
|
||||
|
||||
// ErrCodeNoSuchKey for service response error code
|
||||
// "NoSuchKey".
|
||||
//
|
||||
// The specified key does not exist.
|
||||
ErrCodeNoSuchKey = "NoSuchKey"
|
||||
|
||||
// ErrCodeNoSuchUpload for service response error code
|
||||
// "NoSuchUpload".
|
||||
//
|
||||
// The specified multipart upload does not exist.
|
||||
ErrCodeNoSuchUpload = "NoSuchUpload"
|
||||
|
||||
// ErrCodeObjectAlreadyInActiveTierError for service response error code
|
||||
// "ObjectAlreadyInActiveTierError".
|
||||
//
|
||||
// This operation is not allowed against this storage tier
|
||||
ErrCodeObjectAlreadyInActiveTierError = "ObjectAlreadyInActiveTierError"
|
||||
|
||||
// ErrCodeObjectNotInActiveTierError for service response error code
|
||||
// "ObjectNotInActiveTierError".
|
||||
//
|
||||
// The source object of the COPY operation is not in the active tier and is
|
||||
// only stored in Amazon Glacier.
|
||||
ErrCodeObjectNotInActiveTierError = "ObjectNotInActiveTierError"
|
||||
)
|
58
vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go
generated
vendored
58
vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go
generated
vendored
@ -1,7 +1,6 @@
|
||||
package s3
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"regexp"
|
||||
@ -83,29 +82,31 @@ func updateEndpointForAccelerate(r *request.Request) {
|
||||
|
||||
if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) {
|
||||
r.Error = awserr.New("InvalidParameterException",
|
||||
fmt.Sprintf("bucket name %s is not compatibile with S3 Accelerate", bucket),
|
||||
fmt.Sprintf("bucket name %s is not compatible with S3 Accelerate", bucket),
|
||||
nil)
|
||||
return
|
||||
}
|
||||
|
||||
// Change endpoint from s3(-[a-z0-1-])?.amazonaws.com to s3-accelerate.amazonaws.com
|
||||
r.HTTPRequest.URL.Host = replaceHostRegion(r.HTTPRequest.URL.Host, "accelerate")
|
||||
parts := strings.Split(r.HTTPRequest.URL.Host, ".")
|
||||
if len(parts) < 3 {
|
||||
r.Error = awserr.New("InvalidParameterExecption",
|
||||
fmt.Sprintf("unable to update endpoint host for S3 accelerate, hostname invalid, %s",
|
||||
r.HTTPRequest.URL.Host), nil)
|
||||
return
|
||||
}
|
||||
|
||||
if aws.BoolValue(r.Config.UseDualStack) {
|
||||
host := []byte(r.HTTPRequest.URL.Host)
|
||||
|
||||
// Strip region from hostname
|
||||
if idx := bytes.Index(host, accelElem); idx >= 0 {
|
||||
start := idx + len(accelElem)
|
||||
if end := bytes.IndexByte(host[start:], '.'); end >= 0 {
|
||||
end += start + 1
|
||||
copy(host[start:], host[end:])
|
||||
host = host[:len(host)-(end-start)]
|
||||
r.HTTPRequest.URL.Host = string(host)
|
||||
}
|
||||
if parts[0] == "s3" || strings.HasPrefix(parts[0], "s3-") {
|
||||
parts[0] = "s3-accelerate"
|
||||
}
|
||||
for i := 1; i+1 < len(parts); i++ {
|
||||
if parts[i] == aws.StringValue(r.Config.Region) {
|
||||
parts = append(parts[:i], parts[i+1:]...)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
r.HTTPRequest.URL.Host = strings.Join(parts, ".")
|
||||
|
||||
moveBucketToHost(r.HTTPRequest.URL, bucket)
|
||||
}
|
||||
|
||||
@ -159,28 +160,3 @@ func moveBucketToHost(u *url.URL, bucket string) {
|
||||
u.Path = "/"
|
||||
}
|
||||
}
|
||||
|
||||
const s3HostPrefix = "s3"
|
||||
|
||||
// replaceHostRegion replaces the S3 region string in the host with the
|
||||
// value provided. If v is empty the host prefix returned will be s3.
|
||||
func replaceHostRegion(host, v string) string {
|
||||
if !strings.HasPrefix(host, s3HostPrefix) {
|
||||
return host
|
||||
}
|
||||
|
||||
suffix := host[len(s3HostPrefix):]
|
||||
for i := len(s3HostPrefix); i < len(host); i++ {
|
||||
if host[i] == '.' {
|
||||
// Trim until '.' leave the it in place.
|
||||
suffix = host[i:]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if len(v) == 0 {
|
||||
return fmt.Sprintf("s3%s", suffix)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("s3-%s%s", v, suffix)
|
||||
}
|
||||
|
19
vendor/github.com/aws/aws-sdk-go/service/s3/service.go
generated
vendored
19
vendor/github.com/aws/aws-sdk-go/service/s3/service.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package s3
|
||||
|
||||
@ -12,8 +12,9 @@ import (
|
||||
)
|
||||
|
||||
// S3 is a client for Amazon S3.
|
||||
//The service client's operations are safe to be used concurrently.
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01
|
||||
type S3 struct {
|
||||
*client.Client
|
||||
}
|
||||
@ -24,8 +25,11 @@ var initClient func(*client.Client)
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// A ServiceName is the name of the service the client will make API calls to.
|
||||
const ServiceName = "s3"
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "s3" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the S3 client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
@ -38,17 +42,18 @@ const ServiceName = "s3"
|
||||
// // Create a S3 client with additional configuration
|
||||
// svc := s3.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *S3 {
|
||||
c := p.ClientConfig(ServiceName, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *S3 {
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *S3 {
|
||||
svc := &S3{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2006-03-01",
|
||||
|
5
vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go
generated
vendored
5
vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go
generated
vendored
@ -5,7 +5,6 @@ import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
@ -17,8 +16,8 @@ func copyMultipartStatusOKUnmarhsalError(r *request.Request) {
|
||||
return
|
||||
}
|
||||
body := bytes.NewReader(b)
|
||||
r.HTTPResponse.Body = aws.ReadSeekCloser(body)
|
||||
defer r.HTTPResponse.Body.(aws.ReaderSeekerCloser).Seek(0, 0)
|
||||
r.HTTPResponse.Body = ioutil.NopCloser(body)
|
||||
defer body.Seek(0, 0)
|
||||
|
||||
if body.Len() == 0 {
|
||||
// If there is no body don't attempt to parse the body.
|
||||
|
64
vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go
generated
vendored
64
vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go
generated
vendored
@ -23,17 +23,22 @@ func unmarshalError(r *request.Request) {
|
||||
defer r.HTTPResponse.Body.Close()
|
||||
defer io.Copy(ioutil.Discard, r.HTTPResponse.Body)
|
||||
|
||||
hostID := r.HTTPResponse.Header.Get("X-Amz-Id-2")
|
||||
|
||||
// Bucket exists in a different region, and request needs
|
||||
// to be made to the correct region.
|
||||
if r.HTTPResponse.StatusCode == http.StatusMovedPermanently {
|
||||
r.Error = awserr.NewRequestFailure(
|
||||
awserr.New("BucketRegionError",
|
||||
fmt.Sprintf("incorrect region, the bucket is not in '%s' region",
|
||||
aws.StringValue(r.Config.Region)),
|
||||
nil),
|
||||
r.HTTPResponse.StatusCode,
|
||||
r.RequestID,
|
||||
)
|
||||
r.Error = requestFailure{
|
||||
RequestFailure: awserr.NewRequestFailure(
|
||||
awserr.New("BucketRegionError",
|
||||
fmt.Sprintf("incorrect region, the bucket is not in '%s' region",
|
||||
aws.StringValue(r.Config.Region)),
|
||||
nil),
|
||||
r.HTTPResponse.StatusCode,
|
||||
r.RequestID,
|
||||
),
|
||||
hostID: hostID,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -48,6 +53,7 @@ func unmarshalError(r *request.Request) {
|
||||
} else {
|
||||
errCode = resp.Code
|
||||
errMsg = resp.Message
|
||||
err = nil
|
||||
}
|
||||
|
||||
// Fallback to status code converted to message if still no error code
|
||||
@ -57,9 +63,41 @@ func unmarshalError(r *request.Request) {
|
||||
errMsg = statusText
|
||||
}
|
||||
|
||||
r.Error = awserr.NewRequestFailure(
|
||||
awserr.New(errCode, errMsg, nil),
|
||||
r.HTTPResponse.StatusCode,
|
||||
r.RequestID,
|
||||
)
|
||||
r.Error = requestFailure{
|
||||
RequestFailure: awserr.NewRequestFailure(
|
||||
awserr.New(errCode, errMsg, err),
|
||||
r.HTTPResponse.StatusCode,
|
||||
r.RequestID,
|
||||
),
|
||||
hostID: hostID,
|
||||
}
|
||||
}
|
||||
|
||||
// A RequestFailure provides access to the S3 Request ID and Host ID values
|
||||
// returned from API operation errors. Getting the error as a string will
|
||||
// return the formated error with the same information as awserr.RequestFailure,
|
||||
// while also adding the HostID value from the response.
|
||||
type RequestFailure interface {
|
||||
awserr.RequestFailure
|
||||
|
||||
// Host ID is the S3 Host ID needed for debug, and contacting support
|
||||
HostID() string
|
||||
}
|
||||
|
||||
type requestFailure struct {
|
||||
awserr.RequestFailure
|
||||
|
||||
hostID string
|
||||
}
|
||||
|
||||
func (r requestFailure) Error() string {
|
||||
extra := fmt.Sprintf("status code: %d, request id: %s, host id: %s",
|
||||
r.StatusCode(), r.RequestID(), r.hostID)
|
||||
return awserr.SprintError(r.Code(), r.Message(), extra, r.OrigErr())
|
||||
}
|
||||
func (r requestFailure) String() string {
|
||||
return r.Error()
|
||||
}
|
||||
func (r requestFailure) HostID() string {
|
||||
return r.hostID
|
||||
}
|
||||
|
207
vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go
generated
vendored
207
vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go
generated
vendored
@ -1,9 +1,12 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package s3
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/private/waiter"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// WaitUntilBucketExists uses the Amazon S3 API operation
|
||||
@ -11,44 +14,60 @@ import (
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error {
|
||||
waiterCfg := waiter.Config{
|
||||
Operation: "HeadBucket",
|
||||
Delay: 5,
|
||||
return c.WaitUntilBucketExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilBucketExistsWithContext is an extended version of WaitUntilBucketExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *S3) WaitUntilBucketExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilBucketExists",
|
||||
MaxAttempts: 20,
|
||||
Acceptors: []waiter.WaitAcceptor{
|
||||
Delay: request.ConstantWaiterDelay(5 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: "success",
|
||||
Matcher: "status",
|
||||
Argument: "",
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.StatusWaiterMatch,
|
||||
Expected: 200,
|
||||
},
|
||||
{
|
||||
State: "success",
|
||||
Matcher: "status",
|
||||
Argument: "",
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.StatusWaiterMatch,
|
||||
Expected: 301,
|
||||
},
|
||||
{
|
||||
State: "success",
|
||||
Matcher: "status",
|
||||
Argument: "",
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.StatusWaiterMatch,
|
||||
Expected: 403,
|
||||
},
|
||||
{
|
||||
State: "retry",
|
||||
Matcher: "status",
|
||||
Argument: "",
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.StatusWaiterMatch,
|
||||
Expected: 404,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *HeadBucketInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.HeadBucketRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
w := waiter.Waiter{
|
||||
Client: c,
|
||||
Input: input,
|
||||
Config: waiterCfg,
|
||||
}
|
||||
return w.Wait()
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilBucketNotExists uses the Amazon S3 API operation
|
||||
@ -56,26 +75,45 @@ func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error {
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error {
|
||||
waiterCfg := waiter.Config{
|
||||
Operation: "HeadBucket",
|
||||
Delay: 5,
|
||||
return c.WaitUntilBucketNotExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilBucketNotExistsWithContext is an extended version of WaitUntilBucketNotExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *S3) WaitUntilBucketNotExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilBucketNotExists",
|
||||
MaxAttempts: 20,
|
||||
Acceptors: []waiter.WaitAcceptor{
|
||||
Delay: request.ConstantWaiterDelay(5 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: "success",
|
||||
Matcher: "status",
|
||||
Argument: "",
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.StatusWaiterMatch,
|
||||
Expected: 404,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *HeadBucketInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.HeadBucketRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
w := waiter.Waiter{
|
||||
Client: c,
|
||||
Input: input,
|
||||
Config: waiterCfg,
|
||||
}
|
||||
return w.Wait()
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilObjectExists uses the Amazon S3 API operation
|
||||
@ -83,32 +121,50 @@ func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error {
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error {
|
||||
waiterCfg := waiter.Config{
|
||||
Operation: "HeadObject",
|
||||
Delay: 5,
|
||||
return c.WaitUntilObjectExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilObjectExistsWithContext is an extended version of WaitUntilObjectExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *S3) WaitUntilObjectExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilObjectExists",
|
||||
MaxAttempts: 20,
|
||||
Acceptors: []waiter.WaitAcceptor{
|
||||
Delay: request.ConstantWaiterDelay(5 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: "success",
|
||||
Matcher: "status",
|
||||
Argument: "",
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.StatusWaiterMatch,
|
||||
Expected: 200,
|
||||
},
|
||||
{
|
||||
State: "retry",
|
||||
Matcher: "status",
|
||||
Argument: "",
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.StatusWaiterMatch,
|
||||
Expected: 404,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *HeadObjectInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.HeadObjectRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
w := waiter.Waiter{
|
||||
Client: c,
|
||||
Input: input,
|
||||
Config: waiterCfg,
|
||||
}
|
||||
return w.Wait()
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilObjectNotExists uses the Amazon S3 API operation
|
||||
@ -116,24 +172,43 @@ func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error {
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
func (c *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error {
|
||||
waiterCfg := waiter.Config{
|
||||
Operation: "HeadObject",
|
||||
Delay: 5,
|
||||
return c.WaitUntilObjectNotExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilObjectNotExistsWithContext is an extended version of WaitUntilObjectNotExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *S3) WaitUntilObjectNotExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilObjectNotExists",
|
||||
MaxAttempts: 20,
|
||||
Acceptors: []waiter.WaitAcceptor{
|
||||
Delay: request.ConstantWaiterDelay(5 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: "success",
|
||||
Matcher: "status",
|
||||
Argument: "",
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.StatusWaiterMatch,
|
||||
Expected: 404,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *HeadObjectInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.HeadObjectRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
w := waiter.Waiter{
|
||||
Client: c,
|
||||
Input: input,
|
||||
Config: waiterCfg,
|
||||
}
|
||||
return w.Wait()
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
278
vendor/github.com/aws/aws-sdk-go/service/sts/api.go
generated
vendored
278
vendor/github.com/aws/aws-sdk-go/service/sts/api.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package sts provides a client for AWS Security Token Service.
|
||||
package sts
|
||||
@ -6,6 +6,7 @@ package sts
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awsutil"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
@ -36,6 +37,7 @@ const opAssumeRole = "AssumeRole"
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole
|
||||
func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opAssumeRole,
|
||||
@ -47,9 +49,8 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
|
||||
input = &AssumeRoleInput{}
|
||||
}
|
||||
|
||||
req = c.newRequest(op, input, output)
|
||||
output = &AssumeRoleOutput{}
|
||||
req.Data = output
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
@ -153,26 +154,42 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
|
||||
// API operation AssumeRole for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * MalformedPolicyDocument
|
||||
// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument"
|
||||
// The request was rejected because the policy document was malformed. The error
|
||||
// message describes the specific error.
|
||||
//
|
||||
// * PackedPolicyTooLarge
|
||||
// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge"
|
||||
// The request was rejected because the policy document was too large. The error
|
||||
// message describes how big the policy document is, in packed form, as a percentage
|
||||
// of what the API allows.
|
||||
//
|
||||
// * RegionDisabledException
|
||||
// * ErrCodeRegionDisabledException "RegionDisabledException"
|
||||
// STS is not activated in the requested region for the account that is being
|
||||
// asked to generate credentials. The account administrator must use the IAM
|
||||
// console to activate STS in that region. For more information, see Activating
|
||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole
|
||||
func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error) {
|
||||
req, out := c.AssumeRoleRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// AssumeRoleWithContext is the same as AssumeRole with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See AssumeRole for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *STS) AssumeRoleWithContext(ctx aws.Context, input *AssumeRoleInput, opts ...request.Option) (*AssumeRoleOutput, error) {
|
||||
req, out := c.AssumeRoleRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
const opAssumeRoleWithSAML = "AssumeRoleWithSAML"
|
||||
@ -201,6 +218,7 @@ const opAssumeRoleWithSAML = "AssumeRoleWithSAML"
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML
|
||||
func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *request.Request, output *AssumeRoleWithSAMLOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opAssumeRoleWithSAML,
|
||||
@ -212,9 +230,8 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
|
||||
input = &AssumeRoleWithSAMLInput{}
|
||||
}
|
||||
|
||||
req = c.newRequest(op, input, output)
|
||||
output = &AssumeRoleWithSAMLOutput{}
|
||||
req.Data = output
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
@ -296,41 +313,57 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
|
||||
// API operation AssumeRoleWithSAML for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * MalformedPolicyDocument
|
||||
// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument"
|
||||
// The request was rejected because the policy document was malformed. The error
|
||||
// message describes the specific error.
|
||||
//
|
||||
// * PackedPolicyTooLarge
|
||||
// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge"
|
||||
// The request was rejected because the policy document was too large. The error
|
||||
// message describes how big the policy document is, in packed form, as a percentage
|
||||
// of what the API allows.
|
||||
//
|
||||
// * IDPRejectedClaim
|
||||
// * ErrCodeIDPRejectedClaimException "IDPRejectedClaim"
|
||||
// The identity provider (IdP) reported that authentication failed. This might
|
||||
// be because the claim is invalid.
|
||||
//
|
||||
// If this error is returned for the AssumeRoleWithWebIdentity operation, it
|
||||
// can also mean that the claim has expired or has been explicitly revoked.
|
||||
//
|
||||
// * InvalidIdentityToken
|
||||
// * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken"
|
||||
// The web identity token that was passed could not be validated by AWS. Get
|
||||
// a new identity token from the identity provider and then retry the request.
|
||||
//
|
||||
// * ExpiredTokenException
|
||||
// * ErrCodeExpiredTokenException "ExpiredTokenException"
|
||||
// The web identity token that was passed is expired or is not valid. Get a
|
||||
// new identity token from the identity provider and then retry the request.
|
||||
//
|
||||
// * RegionDisabledException
|
||||
// * ErrCodeRegionDisabledException "RegionDisabledException"
|
||||
// STS is not activated in the requested region for the account that is being
|
||||
// asked to generate credentials. The account administrator must use the IAM
|
||||
// console to activate STS in that region. For more information, see Activating
|
||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML
|
||||
func (c *STS) AssumeRoleWithSAML(input *AssumeRoleWithSAMLInput) (*AssumeRoleWithSAMLOutput, error) {
|
||||
req, out := c.AssumeRoleWithSAMLRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// AssumeRoleWithSAMLWithContext is the same as AssumeRoleWithSAML with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See AssumeRoleWithSAML for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *STS) AssumeRoleWithSAMLWithContext(ctx aws.Context, input *AssumeRoleWithSAMLInput, opts ...request.Option) (*AssumeRoleWithSAMLOutput, error) {
|
||||
req, out := c.AssumeRoleWithSAMLRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity"
|
||||
@ -359,6 +392,7 @@ const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity"
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity
|
||||
func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityInput) (req *request.Request, output *AssumeRoleWithWebIdentityOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opAssumeRoleWithWebIdentity,
|
||||
@ -370,9 +404,8 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
|
||||
input = &AssumeRoleWithWebIdentityInput{}
|
||||
}
|
||||
|
||||
req = c.newRequest(op, input, output)
|
||||
output = &AssumeRoleWithWebIdentityOutput{}
|
||||
req.Data = output
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
@ -447,7 +480,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
|
||||
// For more information about how to use web identity federation and the AssumeRoleWithWebIdentity
|
||||
// API, see the following resources:
|
||||
//
|
||||
// * Using Web Identity Federation APIs for Mobile Apps (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual)
|
||||
// * Using Web Identity Federation APIs for Mobile Apps (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html)
|
||||
// and Federation Through a Web-based Identity Provider (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity).
|
||||
//
|
||||
//
|
||||
@ -476,48 +509,64 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
|
||||
// API operation AssumeRoleWithWebIdentity for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * MalformedPolicyDocument
|
||||
// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument"
|
||||
// The request was rejected because the policy document was malformed. The error
|
||||
// message describes the specific error.
|
||||
//
|
||||
// * PackedPolicyTooLarge
|
||||
// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge"
|
||||
// The request was rejected because the policy document was too large. The error
|
||||
// message describes how big the policy document is, in packed form, as a percentage
|
||||
// of what the API allows.
|
||||
//
|
||||
// * IDPRejectedClaim
|
||||
// * ErrCodeIDPRejectedClaimException "IDPRejectedClaim"
|
||||
// The identity provider (IdP) reported that authentication failed. This might
|
||||
// be because the claim is invalid.
|
||||
//
|
||||
// If this error is returned for the AssumeRoleWithWebIdentity operation, it
|
||||
// can also mean that the claim has expired or has been explicitly revoked.
|
||||
//
|
||||
// * IDPCommunicationError
|
||||
// * ErrCodeIDPCommunicationErrorException "IDPCommunicationError"
|
||||
// The request could not be fulfilled because the non-AWS identity provider
|
||||
// (IDP) that was asked to verify the incoming identity token could not be reached.
|
||||
// This is often a transient error caused by network conditions. Retry the request
|
||||
// a limited number of times so that you don't exceed the request rate. If the
|
||||
// error persists, the non-AWS identity provider might be down or not responding.
|
||||
//
|
||||
// * InvalidIdentityToken
|
||||
// * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken"
|
||||
// The web identity token that was passed could not be validated by AWS. Get
|
||||
// a new identity token from the identity provider and then retry the request.
|
||||
//
|
||||
// * ExpiredTokenException
|
||||
// * ErrCodeExpiredTokenException "ExpiredTokenException"
|
||||
// The web identity token that was passed is expired or is not valid. Get a
|
||||
// new identity token from the identity provider and then retry the request.
|
||||
//
|
||||
// * RegionDisabledException
|
||||
// * ErrCodeRegionDisabledException "RegionDisabledException"
|
||||
// STS is not activated in the requested region for the account that is being
|
||||
// asked to generate credentials. The account administrator must use the IAM
|
||||
// console to activate STS in that region. For more information, see Activating
|
||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity
|
||||
func (c *STS) AssumeRoleWithWebIdentity(input *AssumeRoleWithWebIdentityInput) (*AssumeRoleWithWebIdentityOutput, error) {
|
||||
req, out := c.AssumeRoleWithWebIdentityRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// AssumeRoleWithWebIdentityWithContext is the same as AssumeRoleWithWebIdentity with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See AssumeRoleWithWebIdentity for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *STS) AssumeRoleWithWebIdentityWithContext(ctx aws.Context, input *AssumeRoleWithWebIdentityInput, opts ...request.Option) (*AssumeRoleWithWebIdentityOutput, error) {
|
||||
req, out := c.AssumeRoleWithWebIdentityRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage"
|
||||
@ -546,6 +595,7 @@ const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage"
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage
|
||||
func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessageInput) (req *request.Request, output *DecodeAuthorizationMessageOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opDecodeAuthorizationMessage,
|
||||
@ -557,9 +607,8 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag
|
||||
input = &DecodeAuthorizationMessageInput{}
|
||||
}
|
||||
|
||||
req = c.newRequest(op, input, output)
|
||||
output = &DecodeAuthorizationMessageOutput{}
|
||||
req.Data = output
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
@ -606,15 +655,31 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag
|
||||
// API operation DecodeAuthorizationMessage for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * InvalidAuthorizationMessageException
|
||||
// * ErrCodeInvalidAuthorizationMessageException "InvalidAuthorizationMessageException"
|
||||
// The error returned if the message passed to DecodeAuthorizationMessage was
|
||||
// invalid. This can happen if the token contains invalid characters, such as
|
||||
// linebreaks.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage
|
||||
func (c *STS) DecodeAuthorizationMessage(input *DecodeAuthorizationMessageInput) (*DecodeAuthorizationMessageOutput, error) {
|
||||
req, out := c.DecodeAuthorizationMessageRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// DecodeAuthorizationMessageWithContext is the same as DecodeAuthorizationMessage with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See DecodeAuthorizationMessage for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *STS) DecodeAuthorizationMessageWithContext(ctx aws.Context, input *DecodeAuthorizationMessageInput, opts ...request.Option) (*DecodeAuthorizationMessageOutput, error) {
|
||||
req, out := c.DecodeAuthorizationMessageRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
const opGetCallerIdentity = "GetCallerIdentity"
|
||||
@ -643,6 +708,7 @@ const opGetCallerIdentity = "GetCallerIdentity"
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity
|
||||
func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *request.Request, output *GetCallerIdentityOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opGetCallerIdentity,
|
||||
@ -654,9 +720,8 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ
|
||||
input = &GetCallerIdentityInput{}
|
||||
}
|
||||
|
||||
req = c.newRequest(op, input, output)
|
||||
output = &GetCallerIdentityOutput{}
|
||||
req.Data = output
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
@ -671,10 +736,26 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ
|
||||
//
|
||||
// See the AWS API reference guide for AWS Security Token Service's
|
||||
// API operation GetCallerIdentity for usage and error information.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity
|
||||
func (c *STS) GetCallerIdentity(input *GetCallerIdentityInput) (*GetCallerIdentityOutput, error) {
|
||||
req, out := c.GetCallerIdentityRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// GetCallerIdentityWithContext is the same as GetCallerIdentity with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See GetCallerIdentity for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *STS) GetCallerIdentityWithContext(ctx aws.Context, input *GetCallerIdentityInput, opts ...request.Option) (*GetCallerIdentityOutput, error) {
|
||||
req, out := c.GetCallerIdentityRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
const opGetFederationToken = "GetFederationToken"
|
||||
@ -703,6 +784,7 @@ const opGetFederationToken = "GetFederationToken"
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken
|
||||
func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *request.Request, output *GetFederationTokenOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opGetFederationToken,
|
||||
@ -714,9 +796,8 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re
|
||||
input = &GetFederationTokenInput{}
|
||||
}
|
||||
|
||||
req = c.newRequest(op, input, output)
|
||||
output = &GetFederationTokenOutput{}
|
||||
req.Data = output
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
@ -761,7 +842,7 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re
|
||||
//
|
||||
// * You cannot use these credentials to call any IAM APIs.
|
||||
//
|
||||
// * You cannot call any STS APIs.
|
||||
// * You cannot call any STS APIs except GetCallerIdentity.
|
||||
//
|
||||
// Permissions
|
||||
//
|
||||
@ -809,26 +890,42 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re
|
||||
// API operation GetFederationToken for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * MalformedPolicyDocument
|
||||
// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument"
|
||||
// The request was rejected because the policy document was malformed. The error
|
||||
// message describes the specific error.
|
||||
//
|
||||
// * PackedPolicyTooLarge
|
||||
// * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge"
|
||||
// The request was rejected because the policy document was too large. The error
|
||||
// message describes how big the policy document is, in packed form, as a percentage
|
||||
// of what the API allows.
|
||||
//
|
||||
// * RegionDisabledException
|
||||
// * ErrCodeRegionDisabledException "RegionDisabledException"
|
||||
// STS is not activated in the requested region for the account that is being
|
||||
// asked to generate credentials. The account administrator must use the IAM
|
||||
// console to activate STS in that region. For more information, see Activating
|
||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken
|
||||
func (c *STS) GetFederationToken(input *GetFederationTokenInput) (*GetFederationTokenOutput, error) {
|
||||
req, out := c.GetFederationTokenRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// GetFederationTokenWithContext is the same as GetFederationToken with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See GetFederationToken for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *STS) GetFederationTokenWithContext(ctx aws.Context, input *GetFederationTokenInput, opts ...request.Option) (*GetFederationTokenOutput, error) {
|
||||
req, out := c.GetFederationTokenRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
const opGetSessionToken = "GetSessionToken"
|
||||
@ -857,6 +954,7 @@ const opGetSessionToken = "GetSessionToken"
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken
|
||||
func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.Request, output *GetSessionTokenOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opGetSessionToken,
|
||||
@ -868,9 +966,8 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.
|
||||
input = &GetSessionTokenInput{}
|
||||
}
|
||||
|
||||
req = c.newRequest(op, input, output)
|
||||
output = &GetSessionTokenOutput{}
|
||||
req.Data = output
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
@ -904,7 +1001,7 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.
|
||||
// * You cannot call any IAM APIs unless MFA authentication information is
|
||||
// included in the request.
|
||||
//
|
||||
// * You cannot call any STS API exceptAssumeRole.
|
||||
// * You cannot call any STS API exceptAssumeRole or GetCallerIdentity.
|
||||
//
|
||||
// We recommend that you do not call GetSessionToken with root account credentials.
|
||||
// Instead, follow our best practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users)
|
||||
@ -931,19 +1028,36 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.
|
||||
// API operation GetSessionToken for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * RegionDisabledException
|
||||
// * ErrCodeRegionDisabledException "RegionDisabledException"
|
||||
// STS is not activated in the requested region for the account that is being
|
||||
// asked to generate credentials. The account administrator must use the IAM
|
||||
// console to activate STS in that region. For more information, see Activating
|
||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken
|
||||
func (c *STS) GetSessionToken(input *GetSessionTokenInput) (*GetSessionTokenOutput, error) {
|
||||
req, out := c.GetSessionTokenRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// GetSessionTokenWithContext is the same as GetSessionToken with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See GetSessionToken for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *STS) GetSessionTokenWithContext(ctx aws.Context, input *GetSessionTokenInput, opts ...request.Option) (*GetSessionTokenOutput, error) {
|
||||
req, out := c.GetSessionTokenRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleRequest
|
||||
type AssumeRoleInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -970,10 +1084,9 @@ type AssumeRoleInput struct {
|
||||
// External ID When Granting Access to Your AWS Resources to a Third Party (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// The format for this parameter, as described by its regex pattern, is a string
|
||||
// of characters consisting of upper- and lower-case alphanumeric characters
|
||||
// with no spaces. You can also include underscores or any of the following
|
||||
// characters: =,.@:\/-
|
||||
// The regex used to validated this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can
|
||||
// also include underscores or any of the following characters: =,.@:\/-
|
||||
ExternalId *string `min:"2" type:"string"`
|
||||
|
||||
// An IAM policy in JSON format.
|
||||
@ -1017,10 +1130,9 @@ type AssumeRoleInput struct {
|
||||
// requests using the temporary security credentials will expose the role session
|
||||
// name to the external account in their CloudTrail logs.
|
||||
//
|
||||
// The format for this parameter, as described by its regex pattern, is a string
|
||||
// of characters consisting of upper- and lower-case alphanumeric characters
|
||||
// with no spaces. You can also include underscores or any of the following
|
||||
// characters: =,.@-
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can
|
||||
// also include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// RoleSessionName is a required field
|
||||
RoleSessionName *string `min:"2" type:"string" required:"true"`
|
||||
@ -1031,10 +1143,9 @@ type AssumeRoleInput struct {
|
||||
// The value is either the serial number for a hardware device (such as GAHT12345678)
|
||||
// or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user).
|
||||
//
|
||||
// The format for this parameter, as described by its regex pattern, is a string
|
||||
// of characters consisting of upper- and lower-case alphanumeric characters
|
||||
// with no spaces. You can also include underscores or any of the following
|
||||
// characters: =,.@-
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can
|
||||
// also include underscores or any of the following characters: =,.@-
|
||||
SerialNumber *string `min:"9" type:"string"`
|
||||
|
||||
// The value provided by the MFA device, if the trust policy of the role being
|
||||
@ -1138,6 +1249,7 @@ func (s *AssumeRoleInput) SetTokenCode(v string) *AssumeRoleInput {
|
||||
|
||||
// Contains the response to a successful AssumeRole request, including temporary
|
||||
// AWS credentials that can be used to make AWS requests.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleResponse
|
||||
type AssumeRoleOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1191,6 +1303,7 @@ func (s *AssumeRoleOutput) SetPackedPolicySize(v int64) *AssumeRoleOutput {
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAMLRequest
|
||||
type AssumeRoleWithSAMLInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1331,6 +1444,7 @@ func (s *AssumeRoleWithSAMLInput) SetSAMLAssertion(v string) *AssumeRoleWithSAML
|
||||
|
||||
// Contains the response to a successful AssumeRoleWithSAML request, including
|
||||
// temporary AWS credentials that can be used to make AWS requests.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAMLResponse
|
||||
type AssumeRoleWithSAMLOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1442,6 +1556,7 @@ func (s *AssumeRoleWithSAMLOutput) SetSubjectType(v string) *AssumeRoleWithSAMLO
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentityRequest
|
||||
type AssumeRoleWithWebIdentityInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1503,10 +1618,9 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
// are associated with that user. This session name is included as part of the
|
||||
// ARN and assumed role ID in the AssumedRoleUser response element.
|
||||
//
|
||||
// The format for this parameter, as described by its regex pattern, is a string
|
||||
// of characters consisting of upper- and lower-case alphanumeric characters
|
||||
// with no spaces. You can also include underscores or any of the following
|
||||
// characters: =,.@-
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can
|
||||
// also include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// RoleSessionName is a required field
|
||||
RoleSessionName *string `min:"2" type:"string" required:"true"`
|
||||
@ -1605,6 +1719,7 @@ func (s *AssumeRoleWithWebIdentityInput) SetWebIdentityToken(v string) *AssumeRo
|
||||
|
||||
// Contains the response to a successful AssumeRoleWithWebIdentity request,
|
||||
// including temporary AWS credentials that can be used to make AWS requests.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentityResponse
|
||||
type AssumeRoleWithWebIdentityOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1697,6 +1812,7 @@ func (s *AssumeRoleWithWebIdentityOutput) SetSubjectFromWebIdentityToken(v strin
|
||||
|
||||
// The identifiers for the temporary security credentials that the operation
|
||||
// returns.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumedRoleUser
|
||||
type AssumedRoleUser struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1739,6 +1855,7 @@ func (s *AssumedRoleUser) SetAssumedRoleId(v string) *AssumedRoleUser {
|
||||
}
|
||||
|
||||
// AWS credentials for API authentication.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/Credentials
|
||||
type Credentials struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1797,6 +1914,7 @@ func (s *Credentials) SetSessionToken(v string) *Credentials {
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessageRequest
|
||||
type DecodeAuthorizationMessageInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1841,6 +1959,7 @@ func (s *DecodeAuthorizationMessageInput) SetEncodedMessage(v string) *DecodeAut
|
||||
// A document that contains additional information about the authorization status
|
||||
// of a request from an encoded message that is returned in response to an AWS
|
||||
// request.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessageResponse
|
||||
type DecodeAuthorizationMessageOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1865,6 +1984,7 @@ func (s *DecodeAuthorizationMessageOutput) SetDecodedMessage(v string) *DecodeAu
|
||||
}
|
||||
|
||||
// Identifiers for the federated user that is associated with the credentials.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/FederatedUser
|
||||
type FederatedUser struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1905,6 +2025,7 @@ func (s *FederatedUser) SetFederatedUserId(v string) *FederatedUser {
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentityRequest
|
||||
type GetCallerIdentityInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
}
|
||||
@ -1921,6 +2042,7 @@ func (s GetCallerIdentityInput) GoString() string {
|
||||
|
||||
// Contains the response to a successful GetCallerIdentity request, including
|
||||
// information about the entity making the request.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentityResponse
|
||||
type GetCallerIdentityOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1966,6 +2088,7 @@ func (s *GetCallerIdentityOutput) SetUserId(v string) *GetCallerIdentityOutput {
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenRequest
|
||||
type GetFederationTokenInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -1983,10 +2106,9 @@ type GetFederationTokenInput struct {
|
||||
// the federated user name in a resource-based policy, such as in an Amazon
|
||||
// S3 bucket policy.
|
||||
//
|
||||
// The format for this parameter, as described by its regex pattern, is a string
|
||||
// of characters consisting of upper- and lower-case alphanumeric characters
|
||||
// with no spaces. You can also include underscores or any of the following
|
||||
// characters: =,.@-
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can
|
||||
// also include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// Name is a required field
|
||||
Name *string `min:"2" type:"string" required:"true"`
|
||||
@ -2075,6 +2197,7 @@ func (s *GetFederationTokenInput) SetPolicy(v string) *GetFederationTokenInput {
|
||||
|
||||
// Contains the response to a successful GetFederationToken request, including
|
||||
// temporary AWS credentials that can be used to make AWS requests.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenResponse
|
||||
type GetFederationTokenOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -2127,6 +2250,7 @@ func (s *GetFederationTokenOutput) SetPackedPolicySize(v int64) *GetFederationTo
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionTokenRequest
|
||||
type GetSessionTokenInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
@ -2146,10 +2270,9 @@ type GetSessionTokenInput struct {
|
||||
// You can find the device for an IAM user by going to the AWS Management Console
|
||||
// and viewing the user's security credentials.
|
||||
//
|
||||
// The format for this parameter, as described by its regex pattern, is a string
|
||||
// of characters consisting of upper- and lower-case alphanumeric characters
|
||||
// with no spaces. You can also include underscores or any of the following
|
||||
// characters: =,.@-
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can
|
||||
// also include underscores or any of the following characters: =,.@-
|
||||
SerialNumber *string `min:"9" type:"string"`
|
||||
|
||||
// The value provided by the MFA device, if MFA is required. If any policy requires
|
||||
@ -2212,6 +2335,7 @@ func (s *GetSessionTokenInput) SetTokenCode(v string) *GetSessionTokenInput {
|
||||
|
||||
// Contains the response to a successful GetSessionToken request, including
|
||||
// temporary AWS credentials that can be used to make AWS requests.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionTokenResponse
|
||||
type GetSessionTokenOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
|
73
vendor/github.com/aws/aws-sdk-go/service/sts/errors.go
generated
vendored
Normal file
73
vendor/github.com/aws/aws-sdk-go/service/sts/errors.go
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package sts
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeExpiredTokenException for service response error code
|
||||
// "ExpiredTokenException".
|
||||
//
|
||||
// The web identity token that was passed is expired or is not valid. Get a
|
||||
// new identity token from the identity provider and then retry the request.
|
||||
ErrCodeExpiredTokenException = "ExpiredTokenException"
|
||||
|
||||
// ErrCodeIDPCommunicationErrorException for service response error code
|
||||
// "IDPCommunicationError".
|
||||
//
|
||||
// The request could not be fulfilled because the non-AWS identity provider
|
||||
// (IDP) that was asked to verify the incoming identity token could not be reached.
|
||||
// This is often a transient error caused by network conditions. Retry the request
|
||||
// a limited number of times so that you don't exceed the request rate. If the
|
||||
// error persists, the non-AWS identity provider might be down or not responding.
|
||||
ErrCodeIDPCommunicationErrorException = "IDPCommunicationError"
|
||||
|
||||
// ErrCodeIDPRejectedClaimException for service response error code
|
||||
// "IDPRejectedClaim".
|
||||
//
|
||||
// The identity provider (IdP) reported that authentication failed. This might
|
||||
// be because the claim is invalid.
|
||||
//
|
||||
// If this error is returned for the AssumeRoleWithWebIdentity operation, it
|
||||
// can also mean that the claim has expired or has been explicitly revoked.
|
||||
ErrCodeIDPRejectedClaimException = "IDPRejectedClaim"
|
||||
|
||||
// ErrCodeInvalidAuthorizationMessageException for service response error code
|
||||
// "InvalidAuthorizationMessageException".
|
||||
//
|
||||
// The error returned if the message passed to DecodeAuthorizationMessage was
|
||||
// invalid. This can happen if the token contains invalid characters, such as
|
||||
// linebreaks.
|
||||
ErrCodeInvalidAuthorizationMessageException = "InvalidAuthorizationMessageException"
|
||||
|
||||
// ErrCodeInvalidIdentityTokenException for service response error code
|
||||
// "InvalidIdentityToken".
|
||||
//
|
||||
// The web identity token that was passed could not be validated by AWS. Get
|
||||
// a new identity token from the identity provider and then retry the request.
|
||||
ErrCodeInvalidIdentityTokenException = "InvalidIdentityToken"
|
||||
|
||||
// ErrCodeMalformedPolicyDocumentException for service response error code
|
||||
// "MalformedPolicyDocument".
|
||||
//
|
||||
// The request was rejected because the policy document was malformed. The error
|
||||
// message describes the specific error.
|
||||
ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocument"
|
||||
|
||||
// ErrCodePackedPolicyTooLargeException for service response error code
|
||||
// "PackedPolicyTooLarge".
|
||||
//
|
||||
// The request was rejected because the policy document was too large. The error
|
||||
// message describes how big the policy document is, in packed form, as a percentage
|
||||
// of what the API allows.
|
||||
ErrCodePackedPolicyTooLargeException = "PackedPolicyTooLarge"
|
||||
|
||||
// ErrCodeRegionDisabledException for service response error code
|
||||
// "RegionDisabledException".
|
||||
//
|
||||
// STS is not activated in the requested region for the account that is being
|
||||
// asked to generate credentials. The account administrator must use the IAM
|
||||
// console to activate STS in that region. For more information, see Activating
|
||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||
// in the IAM User Guide.
|
||||
ErrCodeRegionDisabledException = "RegionDisabledException"
|
||||
)
|
19
vendor/github.com/aws/aws-sdk-go/service/sts/service.go
generated
vendored
19
vendor/github.com/aws/aws-sdk-go/service/sts/service.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package sts
|
||||
|
||||
@ -56,8 +56,9 @@ import (
|
||||
// successfully made to STS, who made the request, when it was made, and so
|
||||
// on. To learn more about CloudTrail, including how to turn it on and find
|
||||
// your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
|
||||
//The service client's operations are safe to be used concurrently.
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15
|
||||
type STS struct {
|
||||
*client.Client
|
||||
}
|
||||
@ -68,8 +69,11 @@ var initClient func(*client.Client)
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// A ServiceName is the name of the service the client will make API calls to.
|
||||
const ServiceName = "sts"
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "sts" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the STS client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
@ -82,17 +86,18 @@ const ServiceName = "sts"
|
||||
// // Create a STS client with additional configuration
|
||||
// svc := sts.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *STS {
|
||||
c := p.ClientConfig(ServiceName, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *STS {
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *STS {
|
||||
svc := &STS{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2011-06-15",
|
||||
|
84
vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go
generated
vendored
84
vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go
generated
vendored
@ -1,42 +1,92 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package stsiface provides an interface for the AWS Security Token Service.
|
||||
// Package stsiface provides an interface to enable mocking the AWS Security Token Service service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package stsiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/sts"
|
||||
)
|
||||
|
||||
// STSAPI is the interface type for sts.STS.
|
||||
// STSAPI provides an interface to enable mocking the
|
||||
// sts.STS service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS Security Token Service.
|
||||
// func myFunc(svc stsiface.STSAPI) bool {
|
||||
// // Make svc.AssumeRole request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := sts.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockSTSClient struct {
|
||||
// stsiface.STSAPI
|
||||
// }
|
||||
// func (m *mockSTSClient) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockSTSClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type STSAPI interface {
|
||||
AssumeRole(*sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error)
|
||||
AssumeRoleWithContext(aws.Context, *sts.AssumeRoleInput, ...request.Option) (*sts.AssumeRoleOutput, error)
|
||||
AssumeRoleRequest(*sts.AssumeRoleInput) (*request.Request, *sts.AssumeRoleOutput)
|
||||
|
||||
AssumeRole(*sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error)
|
||||
|
||||
AssumeRoleWithSAML(*sts.AssumeRoleWithSAMLInput) (*sts.AssumeRoleWithSAMLOutput, error)
|
||||
AssumeRoleWithSAMLWithContext(aws.Context, *sts.AssumeRoleWithSAMLInput, ...request.Option) (*sts.AssumeRoleWithSAMLOutput, error)
|
||||
AssumeRoleWithSAMLRequest(*sts.AssumeRoleWithSAMLInput) (*request.Request, *sts.AssumeRoleWithSAMLOutput)
|
||||
|
||||
AssumeRoleWithSAML(*sts.AssumeRoleWithSAMLInput) (*sts.AssumeRoleWithSAMLOutput, error)
|
||||
|
||||
AssumeRoleWithWebIdentity(*sts.AssumeRoleWithWebIdentityInput) (*sts.AssumeRoleWithWebIdentityOutput, error)
|
||||
AssumeRoleWithWebIdentityWithContext(aws.Context, *sts.AssumeRoleWithWebIdentityInput, ...request.Option) (*sts.AssumeRoleWithWebIdentityOutput, error)
|
||||
AssumeRoleWithWebIdentityRequest(*sts.AssumeRoleWithWebIdentityInput) (*request.Request, *sts.AssumeRoleWithWebIdentityOutput)
|
||||
|
||||
AssumeRoleWithWebIdentity(*sts.AssumeRoleWithWebIdentityInput) (*sts.AssumeRoleWithWebIdentityOutput, error)
|
||||
|
||||
DecodeAuthorizationMessage(*sts.DecodeAuthorizationMessageInput) (*sts.DecodeAuthorizationMessageOutput, error)
|
||||
DecodeAuthorizationMessageWithContext(aws.Context, *sts.DecodeAuthorizationMessageInput, ...request.Option) (*sts.DecodeAuthorizationMessageOutput, error)
|
||||
DecodeAuthorizationMessageRequest(*sts.DecodeAuthorizationMessageInput) (*request.Request, *sts.DecodeAuthorizationMessageOutput)
|
||||
|
||||
DecodeAuthorizationMessage(*sts.DecodeAuthorizationMessageInput) (*sts.DecodeAuthorizationMessageOutput, error)
|
||||
|
||||
GetCallerIdentity(*sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error)
|
||||
GetCallerIdentityWithContext(aws.Context, *sts.GetCallerIdentityInput, ...request.Option) (*sts.GetCallerIdentityOutput, error)
|
||||
GetCallerIdentityRequest(*sts.GetCallerIdentityInput) (*request.Request, *sts.GetCallerIdentityOutput)
|
||||
|
||||
GetCallerIdentity(*sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error)
|
||||
|
||||
GetFederationToken(*sts.GetFederationTokenInput) (*sts.GetFederationTokenOutput, error)
|
||||
GetFederationTokenWithContext(aws.Context, *sts.GetFederationTokenInput, ...request.Option) (*sts.GetFederationTokenOutput, error)
|
||||
GetFederationTokenRequest(*sts.GetFederationTokenInput) (*request.Request, *sts.GetFederationTokenOutput)
|
||||
|
||||
GetFederationToken(*sts.GetFederationTokenInput) (*sts.GetFederationTokenOutput, error)
|
||||
|
||||
GetSessionTokenRequest(*sts.GetSessionTokenInput) (*request.Request, *sts.GetSessionTokenOutput)
|
||||
|
||||
GetSessionToken(*sts.GetSessionTokenInput) (*sts.GetSessionTokenOutput, error)
|
||||
GetSessionTokenWithContext(aws.Context, *sts.GetSessionTokenInput, ...request.Option) (*sts.GetSessionTokenOutput, error)
|
||||
GetSessionTokenRequest(*sts.GetSessionTokenInput) (*request.Request, *sts.GetSessionTokenOutput)
|
||||
}
|
||||
|
||||
var _ STSAPI = (*sts.STS)(nil)
|
||||
|
380
vendor/vendor.json
vendored
380
vendor/vendor.json
vendored
@ -7,316 +7,348 @@
|
||||
"revision": ""
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "QLOmSL4B0UFqEIFwCe0TMwehlfE=",
|
||||
"checksumSHA1": "6nleggdedlS1mdzSnu1xf1Pnd+8=",
|
||||
"path": "github.com/aws/aws-sdk-go",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "YOh82spUBNEjU+RS0ib7Z9W7Fp0=",
|
||||
"checksumSHA1": "kf/pd5o5Gl4JZoOwGvgVBQzVbdQ=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "Y9W+4GimK4Fuxq+vyIskVYFRnX4=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/awserr",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "yyYr41HZ1Aq0hWc3J5ijXwYEcac=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/awsutil",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "/232RBWA3KnT7U+wciPS2+wmvR0=",
|
||||
"checksumSHA1": "iThCyNRL/oQFD9CF2SYgBGl+aww=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/client",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "ieAJ+Cvp/PKv1LpUEnUXpc3OI6E=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/client/metadata",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "c1N3Loy3AS9zD+m5CzpPNAED39U=",
|
||||
"checksumSHA1": "0Gfk83qXYimO87ZoK1lL9+ifWHo=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/corehandlers",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "zu5C95rmCZff6NYZb62lEaT5ibE=",
|
||||
"checksumSHA1": "P7gt3PNk6bDOoTZ2N9QOonkaGWw=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/credentials",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "u3GOAJLmdvbuNUeUEcZSEAOeL/0=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "NUJUTWlc1sV8b7WjfiYc4JZbXl0=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "4Ipx+5xN0gso+cENC2MHMWmQlR4=",
|
||||
"checksumSHA1": "6cj/zsRmcxkE1TLS+v910GbQYg0=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/credentials/stscreds",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "DwhFsNluCFEwqzyp3hbJR3q2Wqs=",
|
||||
"checksumSHA1": "l2O7P/kvovK2zxKhuFehFNXLk+Q=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/defaults",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "/EXbk/z2TWjWc1Hvb4QYs3Wmhb8=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/ec2metadata",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "5Ac22YMTBmrX/CXaEIXzWljr8UY=",
|
||||
"checksumSHA1": "+yCOae0vRONrO27QiITkGWblOKk=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/endpoints",
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "/L6UweKsmfyHTu01qrFD1ijzSbE=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/request",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "eOo6evLMAxQfo7Qkc5/h5euN1Sw=",
|
||||
"checksumSHA1": "5pzA5afgeU1alfACFh8z2CDUMao=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/session",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "bjf3WCqht846AsRh85c8d7iLmsk=",
|
||||
"checksumSHA1": "SvIsunO8D9MEKbetMENA4WRnyeE=",
|
||||
"path": "github.com/aws/aws-sdk-go/aws/signer/v4",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "Esab5F8KswqkTdB4TtjSvZgs56k=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/endpoints",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "56L6cAO92x80m7ccyLD5U+o0wpM=",
|
||||
"checksumSHA1": "UkXRa4++RD0AA3UaS8WflQNOm4U=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/model",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "J3VarJ/k1bfFCN+uuEZihcfYOus=",
|
||||
"checksumSHA1": "9cMa8SQME8+G/4fM9J/LQZMy6SM=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/model/api",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "Zmy1WMdxZAYJ6Wpnffxz30s2eQ8=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/model/cli/api-info",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "iI7IPue8fwXsa3ITk8Qbey/K4dw=",
|
||||
"checksumSHA1": "RJ9LoVEemry+7+RVuklcg1PEDoo=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/model/cli/gen-api",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "U503z3SBvUxtceCAyhGOyBiTwSM=",
|
||||
"checksumSHA1": "UgCLu0g+9s+6cCe+BquyzAz7sRA=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/model/cli/gen-endpoints",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "wk7EyvDaHwb5qqoOP/4d3cV0708=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "1QmQ3FqV37w0Zi44qv8pA1GeR0A=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol/ec2query",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "pNeF0Ey7TfBArH5LBQhKOQXQbLY=",
|
||||
"checksumSHA1": "O6hcK24yI6w7FA+g4Pbr+eQ7pys=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "R00RL5jJXRYq1iiK1+PGvMfvXyM=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol/jsonrpc",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "ZqY5RWavBLWTo6j9xqdyBEaNFRk=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol/query",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "5xzix1R8prUyWxgLnzUQoxTsfik=",
|
||||
"checksumSHA1": "Drt1JfLMa0DQEZLWrnMlTWaIcC8=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "mLxtfPJvWIHdYPRY0f19kFuJ3u4=",
|
||||
"checksumSHA1": "VCTh+dEaqqhog5ncy/WTt9+/gFM=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol/rest",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "Rpu8KBtHZgvhkwHxUfaky+qW+G4=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol/restjson",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "ODo+ko8D6unAxZuN1jGzMcN4QCc=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol/restxml",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "eUEkjyMPAuekKBE4ou+nM9tXEas=",
|
||||
"checksumSHA1": "lZ1z4xAbT8euCzKoAsnEYic60VE=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "F6mth+G7dXN1GI+nktaGo8Lx8aE=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/signer/v2",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "01b4hmyUzoReoOyEDylDinWBSdA=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/util",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "Eo9yODN5U99BK0pMzoqnBm7PCrY=",
|
||||
"path": "github.com/aws/aws-sdk-go/private/waiter",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "3jnrRIRHqRiWDqb71FMSfs9AvXk=",
|
||||
"checksumSHA1": "aGx2atOHEXSowjXUQ3UoJ/t2LSI=",
|
||||
"path": "github.com/aws/aws-sdk-go/service/cloudwatch",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "6h4tJ9wVtbYb9wG4srtUxyPoAYM=",
|
||||
"checksumSHA1": "kSXrrHPfK1VaFSAxeNDOkwu7X2U=",
|
||||
"path": "github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface",
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "2PIG7uhrvvDAjiNZINBVCgW/Uds=",
|
||||
"path": "github.com/aws/aws-sdk-go/service/ec2",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "HtKiIAPKsBg2s1c5ytRkdZ/lqO8=",
|
||||
"checksumSHA1": "RHxlu8clKOe30r18os5gd8dZzyE=",
|
||||
"path": "github.com/aws/aws-sdk-go/service/ec2/ec2iface",
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "o7qpn0kxj43Ej/RwfCb9JbzfbfQ=",
|
||||
"path": "github.com/aws/aws-sdk-go/service/s3",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "ouwhxcAsIYQ6oJbMRdLW/Ys/iyg=",
|
||||
"checksumSHA1": "SdsHiTUR9eRarThv/i7y6/rVyF4=",
|
||||
"path": "github.com/aws/aws-sdk-go/service/sts",
|
||||
"revision": "898c81ba64b9a467379d35e3fabad133beae0ee4",
|
||||
"revisionTime": "2016-11-18T23:08:35Z",
|
||||
"version": "v1.5.8",
|
||||
"versionExact": "v1.5.8"
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "Tw/kOijtL1ptv5MHMIWSsXrWayg=",
|
||||
"path": "github.com/aws/aws-sdk-go/service/sts/stsiface",
|
||||
"revision": "200fde3f632bb9f036ec0b8cb29fbc8588155ea5",
|
||||
"revisionTime": "2017-04-07T21:28:24Z",
|
||||
"version": "v1.8.11",
|
||||
"versionExact": "v1.8.11"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "cVyhKIRI2gQrgpn5qrBeAqErmWM=",
|
||||
|
Loading…
Reference in New Issue
Block a user