service.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package sts
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/defaults"
  6. "github.com/aws/aws-sdk-go/aws/request"
  7. "github.com/aws/aws-sdk-go/aws/service"
  8. "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
  9. "github.com/aws/aws-sdk-go/internal/protocol/query"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // The AWS Security Token Service (STS) is a web service that enables you to
  13. // request temporary, limited-privilege credentials for AWS Identity and Access
  14. // Management (IAM) users or for users that you authenticate (federated users).
  15. // This guide provides descriptions of the STS API. For more detailed information
  16. // about using this service, go to Using Temporary Security Credentials (http://docs.aws.amazon.com/STS/latest/UsingSTS/Welcome.html"
  17. // target="_blank).
  18. //
  19. // As an alternative to using the API, you can use one of the AWS SDKs, which
  20. // consist of libraries and sample code for various programming languages and
  21. // platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient
  22. // way to create programmatic access to STS. For example, the SDKs take care
  23. // of cryptographically signing requests, managing errors, and retrying requests
  24. // automatically. For information about the AWS SDKs, including how to download
  25. // and install them, see the Tools for Amazon Web Services page (http://aws.amazon.com/tools/).
  26. // For information about setting up signatures and authorization through the
  27. // API, go to Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html"
  28. // target="_blank) in the AWS General Reference. For general information about
  29. // the Query API, go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html"
  30. // target="_blank) in Using IAM. For information about using security tokens
  31. // with other AWS products, go to Using Temporary Security Credentials to Access
  32. // AWS (http://docs.aws.amazon.com/STS/latest/UsingSTS/UsingTokens.html) in
  33. // Using Temporary Security Credentials.
  34. //
  35. // If you're new to AWS and need additional technical information about a specific
  36. // AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/
  37. // (http://aws.amazon.com/documentation/" target="_blank).
  38. //
  39. // Endpoints
  40. //
  41. // The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com
  42. // that maps to the US East (N. Virginia) region. Additional regions are available,
  43. // but must first be activated in the AWS Management Console before you can
  44. // use a different region's endpoint. For more information about activating
  45. // a region for STS see Activating STS in a New Region (http://docs.aws.amazon.com/STS/latest/UsingSTS/sts-enableregions.html)
  46. // in the Using Temporary Security Credentials guide.
  47. //
  48. // For information about STS endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region)
  49. // in the AWS General Reference.
  50. //
  51. // Recording API requests
  52. //
  53. // STS supports AWS CloudTrail, which is a service that records AWS calls for
  54. // your AWS account and delivers log files to an Amazon S3 bucket. By using
  55. // information collected by CloudTrail, you can determine what requests were
  56. // successfully made to STS, who made the request, when it was made, and so
  57. // on. To learn more about CloudTrail, including how to turn it on and find
  58. // your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
  59. type STS struct {
  60. *service.Service
  61. }
  62. // Used for custom service initialization logic
  63. var initService func(*service.Service)
  64. // Used for custom request initialization logic
  65. var initRequest func(*request.Request)
  66. // New returns a new STS client.
  67. func New(config *aws.Config) *STS {
  68. service := &service.Service{
  69. ServiceInfo: serviceinfo.ServiceInfo{
  70. Config: defaults.DefaultConfig.Merge(config),
  71. ServiceName: "sts",
  72. APIVersion: "2011-06-15",
  73. },
  74. }
  75. service.Initialize()
  76. // Handlers
  77. service.Handlers.Sign.PushBack(v4.Sign)
  78. service.Handlers.Build.PushBack(query.Build)
  79. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  80. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  81. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  82. // Run custom service initialization if present
  83. if initService != nil {
  84. initService(service)
  85. }
  86. return &STS{service}
  87. }
  88. // newRequest creates a new request for a STS operation and runs any
  89. // custom request initialization.
  90. func (c *STS) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  91. req := c.NewRequest(op, params, data)
  92. // Run custom request initialization if present
  93. if initRequest != nil {
  94. initRequest(req)
  95. }
  96. return req
  97. }