mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-03 05:00:56 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+2755
File diff suppressed because it is too large
Load Diff
+35
@@ -0,0 +1,35 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package signer provides the client and types for making API
|
||||
// requests to AWS Signer.
|
||||
//
|
||||
// You can use Code Signing for Amazon FreeRTOS (AWS Signer) to sign code that
|
||||
// you created for any of the IoT devices that Amazon Web Services supports.
|
||||
// AWS Signer is integrated with Amazon FreeRTOS, AWS Certificate Manager, and
|
||||
// AWS CloudTrail. Amazon FreeRTOS customers can use AWS Signer to sign code
|
||||
// images before making them available for microcontrollers. You can use ACM
|
||||
// to import third-party certificates to be used by AWS Signer. For general
|
||||
// information about using AWS Signer, see the Code Signing for Amazon FreeRTOS
|
||||
// Developer Guide (http://docs.aws.amazon.com/signer/latest/developerguide/Welcome.html).
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/signer-2017-08-25 for more information on this service.
|
||||
//
|
||||
// See signer package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/signer/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact AWS Signer with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the AWS Signer client Signer for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/signer/#New
|
||||
package signer
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package signer
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeAccessDeniedException for service response error code
|
||||
// "AccessDeniedException".
|
||||
//
|
||||
// You do not have sufficient access to perform this action.
|
||||
ErrCodeAccessDeniedException = "AccessDeniedException"
|
||||
|
||||
// ErrCodeInternalServiceErrorException for service response error code
|
||||
// "InternalServiceErrorException".
|
||||
//
|
||||
// An internal error occurred.
|
||||
ErrCodeInternalServiceErrorException = "InternalServiceErrorException"
|
||||
|
||||
// ErrCodeResourceNotFoundException for service response error code
|
||||
// "ResourceNotFoundException".
|
||||
//
|
||||
// A specified resource could not be found.
|
||||
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
|
||||
|
||||
// ErrCodeThrottlingException for service response error code
|
||||
// "ThrottlingException".
|
||||
//
|
||||
// The signing job has been throttled.
|
||||
ErrCodeThrottlingException = "ThrottlingException"
|
||||
|
||||
// ErrCodeValidationException for service response error code
|
||||
// "ValidationException".
|
||||
//
|
||||
// You signing certificate could not be validated.
|
||||
ErrCodeValidationException = "ValidationException"
|
||||
)
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package signer
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/restjson"
|
||||
)
|
||||
|
||||
// Signer provides the API operation methods for making requests to
|
||||
// AWS Signer. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// Signer methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type Signer struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "signer" // Name of service.
|
||||
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||
ServiceID = "signer" // ServiceID is a unique identifer of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the Signer client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a Signer client from just a session.
|
||||
// svc := signer.New(mySession)
|
||||
//
|
||||
// // Create a Signer client with additional configuration
|
||||
// svc := signer.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Signer {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
if c.SigningNameDerived || len(c.SigningName) == 0 {
|
||||
c.SigningName = "signer"
|
||||
}
|
||||
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, signingName string) *Signer {
|
||||
svc := &Signer{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2017-08-25",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a Signer operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *Signer) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package signeriface provides an interface to enable mocking the AWS Signer 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 signeriface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/signer"
|
||||
)
|
||||
|
||||
// SignerAPI provides an interface to enable mocking the
|
||||
// signer.Signer 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 SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS Signer.
|
||||
// func myFunc(svc signeriface.SignerAPI) bool {
|
||||
// // Make svc.CancelSigningProfile request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := signer.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockSignerClient struct {
|
||||
// signeriface.SignerAPI
|
||||
// }
|
||||
// func (m *mockSignerClient) CancelSigningProfile(input *signer.CancelSigningProfileInput) (*signer.CancelSigningProfileOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockSignerClient{}
|
||||
//
|
||||
// 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 SignerAPI interface {
|
||||
CancelSigningProfile(*signer.CancelSigningProfileInput) (*signer.CancelSigningProfileOutput, error)
|
||||
CancelSigningProfileWithContext(aws.Context, *signer.CancelSigningProfileInput, ...request.Option) (*signer.CancelSigningProfileOutput, error)
|
||||
CancelSigningProfileRequest(*signer.CancelSigningProfileInput) (*request.Request, *signer.CancelSigningProfileOutput)
|
||||
|
||||
DescribeSigningJob(*signer.DescribeSigningJobInput) (*signer.DescribeSigningJobOutput, error)
|
||||
DescribeSigningJobWithContext(aws.Context, *signer.DescribeSigningJobInput, ...request.Option) (*signer.DescribeSigningJobOutput, error)
|
||||
DescribeSigningJobRequest(*signer.DescribeSigningJobInput) (*request.Request, *signer.DescribeSigningJobOutput)
|
||||
|
||||
GetSigningPlatform(*signer.GetSigningPlatformInput) (*signer.GetSigningPlatformOutput, error)
|
||||
GetSigningPlatformWithContext(aws.Context, *signer.GetSigningPlatformInput, ...request.Option) (*signer.GetSigningPlatformOutput, error)
|
||||
GetSigningPlatformRequest(*signer.GetSigningPlatformInput) (*request.Request, *signer.GetSigningPlatformOutput)
|
||||
|
||||
GetSigningProfile(*signer.GetSigningProfileInput) (*signer.GetSigningProfileOutput, error)
|
||||
GetSigningProfileWithContext(aws.Context, *signer.GetSigningProfileInput, ...request.Option) (*signer.GetSigningProfileOutput, error)
|
||||
GetSigningProfileRequest(*signer.GetSigningProfileInput) (*request.Request, *signer.GetSigningProfileOutput)
|
||||
|
||||
ListSigningJobs(*signer.ListSigningJobsInput) (*signer.ListSigningJobsOutput, error)
|
||||
ListSigningJobsWithContext(aws.Context, *signer.ListSigningJobsInput, ...request.Option) (*signer.ListSigningJobsOutput, error)
|
||||
ListSigningJobsRequest(*signer.ListSigningJobsInput) (*request.Request, *signer.ListSigningJobsOutput)
|
||||
|
||||
ListSigningJobsPages(*signer.ListSigningJobsInput, func(*signer.ListSigningJobsOutput, bool) bool) error
|
||||
ListSigningJobsPagesWithContext(aws.Context, *signer.ListSigningJobsInput, func(*signer.ListSigningJobsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListSigningPlatforms(*signer.ListSigningPlatformsInput) (*signer.ListSigningPlatformsOutput, error)
|
||||
ListSigningPlatformsWithContext(aws.Context, *signer.ListSigningPlatformsInput, ...request.Option) (*signer.ListSigningPlatformsOutput, error)
|
||||
ListSigningPlatformsRequest(*signer.ListSigningPlatformsInput) (*request.Request, *signer.ListSigningPlatformsOutput)
|
||||
|
||||
ListSigningPlatformsPages(*signer.ListSigningPlatformsInput, func(*signer.ListSigningPlatformsOutput, bool) bool) error
|
||||
ListSigningPlatformsPagesWithContext(aws.Context, *signer.ListSigningPlatformsInput, func(*signer.ListSigningPlatformsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListSigningProfiles(*signer.ListSigningProfilesInput) (*signer.ListSigningProfilesOutput, error)
|
||||
ListSigningProfilesWithContext(aws.Context, *signer.ListSigningProfilesInput, ...request.Option) (*signer.ListSigningProfilesOutput, error)
|
||||
ListSigningProfilesRequest(*signer.ListSigningProfilesInput) (*request.Request, *signer.ListSigningProfilesOutput)
|
||||
|
||||
ListSigningProfilesPages(*signer.ListSigningProfilesInput, func(*signer.ListSigningProfilesOutput, bool) bool) error
|
||||
ListSigningProfilesPagesWithContext(aws.Context, *signer.ListSigningProfilesInput, func(*signer.ListSigningProfilesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
PutSigningProfile(*signer.PutSigningProfileInput) (*signer.PutSigningProfileOutput, error)
|
||||
PutSigningProfileWithContext(aws.Context, *signer.PutSigningProfileInput, ...request.Option) (*signer.PutSigningProfileOutput, error)
|
||||
PutSigningProfileRequest(*signer.PutSigningProfileInput) (*request.Request, *signer.PutSigningProfileOutput)
|
||||
|
||||
StartSigningJob(*signer.StartSigningJobInput) (*signer.StartSigningJobOutput, error)
|
||||
StartSigningJobWithContext(aws.Context, *signer.StartSigningJobInput, ...request.Option) (*signer.StartSigningJobOutput, error)
|
||||
StartSigningJobRequest(*signer.StartSigningJobInput) (*request.Request, *signer.StartSigningJobOutput)
|
||||
|
||||
WaitUntilSuccessfulSigningJob(*signer.DescribeSigningJobInput) error
|
||||
WaitUntilSuccessfulSigningJobWithContext(aws.Context, *signer.DescribeSigningJobInput, ...request.WaiterOption) error
|
||||
}
|
||||
|
||||
var _ SignerAPI = (*signer.Signer)(nil)
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package signer
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// WaitUntilSuccessfulSigningJob uses the signer API operation
|
||||
// DescribeSigningJob to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *Signer) WaitUntilSuccessfulSigningJob(input *DescribeSigningJobInput) error {
|
||||
return c.WaitUntilSuccessfulSigningJobWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilSuccessfulSigningJobWithContext is an extended version of WaitUntilSuccessfulSigningJob.
|
||||
// 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 *Signer) WaitUntilSuccessfulSigningJobWithContext(ctx aws.Context, input *DescribeSigningJobInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilSuccessfulSigningJob",
|
||||
MaxAttempts: 25,
|
||||
Delay: request.ConstantWaiterDelay(20 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "status",
|
||||
Expected: "Succeeded",
|
||||
},
|
||||
{
|
||||
State: request.FailureWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "status",
|
||||
Expected: "Failed",
|
||||
},
|
||||
{
|
||||
State: request.FailureWaiterState,
|
||||
Matcher: request.ErrorWaiterMatch,
|
||||
Expected: "ResourceNotFoundException",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeSigningJobInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeSigningJobRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
Reference in New Issue
Block a user