mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 19:47:54 +00:00
Remove structs/mapstructure tags from auth/aws
This commit is contained in:
@@ -418,8 +418,8 @@ func (b *backend) pathConfigCertificateCreateUpdate(ctx context.Context, req *lo
|
||||
// Struct awsPublicCert holds the AWS Public Key that is used to verify the PKCS#7 signature
|
||||
// of the instnace identity document.
|
||||
type awsPublicCert struct {
|
||||
AWSPublicCert string `json:"aws_public_cert" structs:"aws_public_cert" mapstructure:"aws_public_cert"`
|
||||
Type string `json:"type" structs:"type" mapstructure:"type"`
|
||||
AWSPublicCert string `json:"aws_public_cert"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
const pathConfigCertificateSyn = `
|
||||
|
||||
@@ -268,12 +268,12 @@ func (b *backend) pathConfigClientCreateUpdate(ctx context.Context, req *logical
|
||||
// Struct to hold 'aws_access_key' and 'aws_secret_key' that are required to
|
||||
// interact with the AWS EC2 API.
|
||||
type clientConfig struct {
|
||||
AccessKey string `json:"access_key" mapstructure:"access_key"`
|
||||
SecretKey string `json:"secret_key" mapstructure:"secret_key"`
|
||||
Endpoint string `json:"endpoint" mapstructure:"endpoint"`
|
||||
IAMEndpoint string `json:"iam_endpoint" mapstructure:"iam_endpoint"`
|
||||
STSEndpoint string `json:"sts_endpoint" mapstructure:"sts_endpoint"`
|
||||
IAMServerIdHeaderValue string `json:"iam_server_id_header_value" mapstructure:"iam_server_id_header_value"`
|
||||
AccessKey string `json:"access_key"`
|
||||
SecretKey string `json:"secret_key"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
IAMEndpoint string `json:"iam_endpoint"`
|
||||
STSEndpoint string `json:"sts_endpoint"`
|
||||
IAMServerIdHeaderValue string `json:"iam_server_id_header_value"`
|
||||
MaxRetries int `json:"max_retries"`
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
// awsStsEntry is used to store details of an STS role for assumption
|
||||
type awsStsEntry struct {
|
||||
StsRole string `json:"sts_role" mapstructure:"sts_role"`
|
||||
StsRole string `json:"sts_role"`
|
||||
}
|
||||
|
||||
func pathListSts(b *backend) *framework.Path {
|
||||
|
||||
@@ -137,8 +137,8 @@ func (b *backend) pathConfigTidyIdentityWhitelistDelete(ctx context.Context, req
|
||||
}
|
||||
|
||||
type tidyWhitelistIdentityConfig struct {
|
||||
SafetyBuffer int `json:"safety_buffer" mapstructure:"safety_buffer"`
|
||||
DisablePeriodicTidy bool `json:"disable_periodic_tidy" mapstructure:"disable_periodic_tidy"`
|
||||
SafetyBuffer int `json:"safety_buffer"`
|
||||
DisablePeriodicTidy bool `json:"disable_periodic_tidy"`
|
||||
}
|
||||
|
||||
const pathConfigTidyIdentityWhitelistHelpSyn = `
|
||||
|
||||
@@ -138,8 +138,8 @@ func (b *backend) pathConfigTidyRoletagBlacklistDelete(ctx context.Context, req
|
||||
}
|
||||
|
||||
type tidyBlacklistRoleTagConfig struct {
|
||||
SafetyBuffer int `json:"safety_buffer" mapstructure:"safety_buffer"`
|
||||
DisablePeriodicTidy bool `json:"disable_periodic_tidy" mapstructure:"disable_periodic_tidy"`
|
||||
SafetyBuffer int `json:"safety_buffer"`
|
||||
DisablePeriodicTidy bool `json:"disable_periodic_tidy"`
|
||||
}
|
||||
|
||||
const pathConfigTidyRoletagBlacklistHelpSyn = `
|
||||
|
||||
@@ -123,13 +123,13 @@ func (b *backend) pathIdentityWhitelistRead(ctx context.Context, req *logical.Re
|
||||
|
||||
// Struct to represent each item in the identity whitelist.
|
||||
type whitelistIdentity struct {
|
||||
Role string `json:"role" mapstructure:"role"`
|
||||
ClientNonce string `json:"client_nonce" mapstructure:"client_nonce"`
|
||||
CreationTime time.Time `json:"creation_time" mapstructure:"creation_time"`
|
||||
DisallowReauthentication bool `json:"disallow_reauthentication" mapstructure:"disallow_reauthentication"`
|
||||
PendingTime string `json:"pending_time" mapstructure:"pending_time"`
|
||||
ExpirationTime time.Time `json:"expiration_time" mapstructure:"expiration_time"`
|
||||
LastUpdatedTime time.Time `json:"last_updated_time" mapstructure:"last_updated_time"`
|
||||
Role string `json:"role"`
|
||||
ClientNonce string `json:"client_nonce"`
|
||||
CreationTime time.Time `json:"creation_time"`
|
||||
DisallowReauthentication bool `json:"disallow_reauthentication"`
|
||||
PendingTime string `json:"pending_time"`
|
||||
ExpirationTime time.Time `json:"expiration_time"`
|
||||
LastUpdatedTime time.Time `json:"last_updated_time"`
|
||||
}
|
||||
|
||||
const pathIdentityWhitelistSyn = `
|
||||
|
||||
@@ -1549,20 +1549,20 @@ type ResponseMetadata struct {
|
||||
// identityDocument represents the items of interest from the EC2 instance
|
||||
// identity document
|
||||
type identityDocument struct {
|
||||
Tags map[string]interface{} `json:"tags,omitempty" structs:"tags" mapstructure:"tags"`
|
||||
InstanceID string `json:"instanceId,omitempty" structs:"instanceId" mapstructure:"instanceId"`
|
||||
AmiID string `json:"imageId,omitempty" structs:"imageId" mapstructure:"imageId"`
|
||||
AccountID string `json:"accountId,omitempty" structs:"accountId" mapstructure:"accountId"`
|
||||
Region string `json:"region,omitempty" structs:"region" mapstructure:"region"`
|
||||
PendingTime string `json:"pendingTime,omitempty" structs:"pendingTime" mapstructure:"pendingTime"`
|
||||
Tags map[string]interface{} `json:"tags,omitempty"`
|
||||
InstanceID string `json:"instanceId,omitempty"`
|
||||
AmiID string `json:"imageId,omitempty"`
|
||||
AccountID string `json:"accountId,omitempty"`
|
||||
Region string `json:"region,omitempty"`
|
||||
PendingTime string `json:"pendingTime,omitempty"`
|
||||
}
|
||||
|
||||
// roleTagLoginResponse represents the return values required after the process
|
||||
// of verifying a role tag login
|
||||
type roleTagLoginResponse struct {
|
||||
Policies []string `json:"policies" structs:"policies" mapstructure:"policies"`
|
||||
MaxTTL time.Duration `json:"max_ttl" structs:"max_ttl" mapstructure:"max_ttl"`
|
||||
DisallowReauthentication bool `json:"disallow_reauthentication" structs:"disallow_reauthentication" mapstructure:"disallow_reauthentication"`
|
||||
Policies []string `json:"policies"`
|
||||
MaxTTL time.Duration `json:"max_ttl"`
|
||||
DisallowReauthentication bool `json:"disallow_reauthentication"`
|
||||
}
|
||||
|
||||
type iamEntity struct {
|
||||
|
||||
@@ -753,27 +753,27 @@ func (b *backend) pathRoleCreateUpdate(ctx context.Context, req *logical.Request
|
||||
|
||||
// Struct to hold the information associated with an AMI ID in Vault.
|
||||
type awsRoleEntry struct {
|
||||
AuthType string `json:"auth_type" mapstructure:"auth_type"`
|
||||
BoundAmiID string `json:"bound_ami_id" mapstructure:"bound_ami_id"`
|
||||
BoundAccountID string `json:"bound_account_id" mapstructure:"bound_account_id"`
|
||||
BoundIamPrincipalARN string `json:"bound_iam_principal_arn" mapstructure:"bound_iam_principal_arn"`
|
||||
BoundIamPrincipalID string `json:"bound_iam_principal_id" mapstructure:"bound_iam_principal_id"`
|
||||
BoundIamRoleARN string `json:"bound_iam_role_arn" mapstructure:"bound_iam_role_arn"`
|
||||
BoundIamInstanceProfileARN string `json:"bound_iam_instance_profile_arn" mapstructure:"bound_iam_instance_profile_arn"`
|
||||
BoundRegion string `json:"bound_region" mapstructure:"bound_region"`
|
||||
BoundSubnetID string `json:"bound_subnet_id" mapstructure:"bound_subnet_id"`
|
||||
BoundVpcID string `json:"bound_vpc_id" mapstructure:"bound_vpc_id"`
|
||||
InferredEntityType string `json:"inferred_entity_type" mapstructure:"inferred_entity_type"`
|
||||
InferredAWSRegion string `json:"inferred_aws_region" mapstructure:"inferred_aws_region"`
|
||||
ResolveAWSUniqueIDs bool `json:"resolve_aws_unique_ids" mapstructure:"resolve_aws_unique_ids"`
|
||||
RoleTag string `json:"role_tag" mapstructure:"role_tag"`
|
||||
AllowInstanceMigration bool `json:"allow_instance_migration" mapstructure:"allow_instance_migration"`
|
||||
TTL time.Duration `json:"ttl" mapstructure:"ttl"`
|
||||
MaxTTL time.Duration `json:"max_ttl" mapstructure:"max_ttl"`
|
||||
Policies []string `json:"policies" mapstructure:"policies"`
|
||||
DisallowReauthentication bool `json:"disallow_reauthentication" mapstructure:"disallow_reauthentication"`
|
||||
HMACKey string `json:"hmac_key" mapstructure:"hmac_key"`
|
||||
Period time.Duration `json:"period" mapstructure:"period"`
|
||||
AuthType string `json:"auth_type"`
|
||||
BoundAmiID string `json:"bound_ami_id"`
|
||||
BoundAccountID string `json:"bound_account_id"`
|
||||
BoundIamPrincipalARN string `json:"bound_iam_principal_arn"`
|
||||
BoundIamPrincipalID string `json:"bound_iam_principal_id"`
|
||||
BoundIamRoleARN string `json:"bound_iam_role_arn"`
|
||||
BoundIamInstanceProfileARN string `json:"bound_iam_instance_profile_arn"`
|
||||
BoundRegion string `json:"bound_region"`
|
||||
BoundSubnetID string `json:"bound_subnet_id"`
|
||||
BoundVpcID string `json:"bound_vpc_id"`
|
||||
InferredEntityType string `json:"inferred_entity_type"`
|
||||
InferredAWSRegion string `json:"inferred_aws_region"`
|
||||
ResolveAWSUniqueIDs bool `json:"resolve_aws_unique_ids"`
|
||||
RoleTag string `json:"role_tag"`
|
||||
AllowInstanceMigration bool `json:"allow_instance_migration"`
|
||||
TTL time.Duration `json:"ttl"`
|
||||
MaxTTL time.Duration `json:"max_ttl"`
|
||||
Policies []string `json:"policies"`
|
||||
DisallowReauthentication bool `json:"disallow_reauthentication"`
|
||||
HMACKey string `json:"hmac_key"`
|
||||
Period time.Duration `json:"period"`
|
||||
}
|
||||
|
||||
const pathRoleSyn = `
|
||||
|
||||
@@ -392,15 +392,15 @@ func createRoleTagNonce() (string, error) {
|
||||
|
||||
// Struct roleTag represents a role tag in a struc form.
|
||||
type roleTag struct {
|
||||
Version string `json:"version" structs:"version" mapstructure:"version"`
|
||||
InstanceID string `json:"instance_id" structs:"instance_id" mapstructure:"instance_id"`
|
||||
Nonce string `json:"nonce" structs:"nonce" mapstructure:"nonce"`
|
||||
Policies []string `json:"policies" structs:"policies" mapstructure:"policies"`
|
||||
MaxTTL time.Duration `json:"max_ttl" structs:"max_ttl" mapstructure:"max_ttl"`
|
||||
Role string `json:"role" structs:"role" mapstructure:"role"`
|
||||
HMAC string `json:"hmac" structs:"hmac" mapstructure:"hmac"`
|
||||
DisallowReauthentication bool `json:"disallow_reauthentication" structs:"disallow_reauthentication" mapstructure:"disallow_reauthentication"`
|
||||
AllowInstanceMigration bool `json:"allow_instance_migration" structs:"allow_instance_migration" mapstructure:"allow_instance_migration"`
|
||||
Version string `json:"version"`
|
||||
InstanceID string `json:"instance_id"`
|
||||
Nonce string `json:"nonce"`
|
||||
Policies []string `json:"policies"`
|
||||
MaxTTL time.Duration `json:"max_ttl"`
|
||||
Role string `json:"role"`
|
||||
HMAC string `json:"hmac"`
|
||||
DisallowReauthentication bool `json:"disallow_reauthentication"`
|
||||
AllowInstanceMigration bool `json:"allow_instance_migration"`
|
||||
}
|
||||
|
||||
func (rTag1 *roleTag) Equal(rTag2 *roleTag) bool {
|
||||
|
||||
@@ -219,8 +219,8 @@ func (b *backend) pathRoletagBlacklistUpdate(ctx context.Context, req *logical.R
|
||||
}
|
||||
|
||||
type roleTagBlacklistEntry struct {
|
||||
CreationTime time.Time `json:"creation_time" structs:"creation_time" mapstructure:"creation_time"`
|
||||
ExpirationTime time.Time `json:"expiration_time" structs:"expiration_time" mapstructure:"expiration_time"`
|
||||
CreationTime time.Time `json:"creation_time"`
|
||||
ExpirationTime time.Time `json:"expiration_time"`
|
||||
}
|
||||
|
||||
const pathRoletagBlacklistSyn = `
|
||||
|
||||
Reference in New Issue
Block a user