Documentation ¶
Overview ¶
Package s3creds provides support for HSDP S3 Credentials
Index ¶
Constants ¶
const (
CredentialsAPIVersion = "2"
)
Constants
Variables ¶
var ( ErrNotFound = errors.New("entity not found") ErrMissingManagingOrganization = errors.New("missing managing organization") ErrMissingName = errors.New("missing name value") ErrMissingDescription = errors.New("missing description value") ErrMalformedInputValue = errors.New("malformed input value") ErrMissingOrganization = errors.New("missing organization") ErrMissingProposition = errors.New("missing proposition") ErrMissingGlobalReference = errors.New("missing global reference") ErrMissingProductKey = errors.New("missing product key") ErrNotImplementedByHSDP = errors.New("method not implemented by HSDP") ErrEmptyResults = errors.New("empty results") ErrOperationFailed = errors.New("operation failed") ErrBaseURLCannotBeEmpty = errors.New("credentials base URL cannot be empty") ErrCouldNoReadResourceAfterCreate = errors.New("could not read resource after create") ErrEmptyResult = errors.New("empty result") )
Exported Errors
Functions ¶
This section is empty.
Types ¶
type Access ¶
type Access struct { Allowed struct { Resources []string `json:"resources"` Actions []string `json:"actions"` } `json:"allowed"` Credentials struct { AccessKey string `json:"accessKey"` SecretKey string `json:"secretKey"` SessionToken string `json:"sessionToken"` Expires string `json:"expires"` Bucket string `json:"bucket"` } `json:"credentials"` }
type AccessService ¶
type AccessService struct {
// contains filtered or unexported fields
}
func (*AccessService) GetAccess ¶
func (c *AccessService) GetAccess(opt *GetAccessOptions, options ...OptionFunc) ([]*Access, *Response, error)
GetPolicy searches for polices
type Client ¶
type Client struct { // User agent used when communicating with the HSDP IAM API. UserAgent string Policy *PolicyService Access *AccessService // contains filtered or unexported fields }
A Client manages communication with HSDP IAM API
func NewClient ¶
NewClient returns a new HSDP Credenials API client. A configured IAM client must be provided
func (*Client) Do ¶
Do executes a http request. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) SetBaseURL ¶
SetBaseURL sets the base URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response `json:"-"` Code string `json:"responseCode"` Message string `json:"responseMessage"` }
ErrorResponse represents an IAM errors response containing a code and a human readable message
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type GetAccessOptions ¶
type GetAccessOptions struct {
ProductKey *string `url:"-"`
}
GetAccessOptions describes the fields on which you can search for policies
type GetPolicyOptions ¶
type GetPolicyOptions struct { ManagingOrg *string `url:"managing-org,omitempty"` GroupName *string `url:"group-name,omitempty"` ID *int `url:"id,omitempty"` ProductKey *string `url:"-"` }
GetPolicyOptions describes the fields on which you can search for policies
type OptionFunc ¶
OptionFunc is the function signature function for options
type Policy ¶
type Policy struct { ID int `json:"id,omitempty"` ResourceType string `json:"resourceType,omitempty"` Conditions struct { ManagingOrganizations []string `json:"managingOrganizations,omitempty"` Groups []string `json:"groups,omitempty"` } `json:"conditions,omitempty"` Allowed struct { Resources []string `json:"resources" validate:"min=1"` Actions []string `json:"actions" validate:"policyActions,min=1,unique"` } `json:"allowed"` ProductKey string `json:"-"` }
type PolicyService ¶
type PolicyService struct {
// contains filtered or unexported fields
}
PolicyService provides operations on S3 Credentials Policies
func (*PolicyService) CreatePolicy ¶
func (c *PolicyService) CreatePolicy(policy Policy) (*Policy, *Response, error)
CreatePolicy creates a new policy for S3 Credentials
func (*PolicyService) DeletePolicy ¶
func (c *PolicyService) DeletePolicy(policy Policy) (bool, *Response, error)
DeleteGroup deletes the given Group
func (*PolicyService) GetPolicy ¶
func (c *PolicyService) GetPolicy(opt *GetPolicyOptions, options ...OptionFunc) ([]*Policy, *Response, error)
GetPolicy searches for polices