gofmt files (#5233)
This commit is contained in:
parent
c52f3c5a24
commit
9988ace85e
|
@ -897,8 +897,8 @@ func (b *backend) handleRoleTagLogin(ctx context.Context, s logical.Storage, rol
|
||||||
}
|
}
|
||||||
|
|
||||||
return &roleTagLoginResponse{
|
return &roleTagLoginResponse{
|
||||||
Policies: rTag.Policies,
|
Policies: rTag.Policies,
|
||||||
MaxTTL: rTag.MaxTTL,
|
MaxTTL: rTag.MaxTTL,
|
||||||
DisallowReauthentication: rTag.DisallowReauthentication,
|
DisallowReauthentication: rTag.DisallowReauthentication,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -860,11 +860,11 @@ func (r *awsRoleEntry) ToResponseData() map[string]interface{} {
|
||||||
"resolve_aws_unique_ids": r.ResolveAWSUniqueIDs,
|
"resolve_aws_unique_ids": r.ResolveAWSUniqueIDs,
|
||||||
"role_tag": r.RoleTag,
|
"role_tag": r.RoleTag,
|
||||||
"allow_instance_migration": r.AllowInstanceMigration,
|
"allow_instance_migration": r.AllowInstanceMigration,
|
||||||
"ttl": r.TTL / time.Second,
|
"ttl": r.TTL / time.Second,
|
||||||
"max_ttl": r.MaxTTL / time.Second,
|
"max_ttl": r.MaxTTL / time.Second,
|
||||||
"policies": r.Policies,
|
"policies": r.Policies,
|
||||||
"disallow_reauthentication": r.DisallowReauthentication,
|
"disallow_reauthentication": r.DisallowReauthentication,
|
||||||
"period": r.Period / time.Second,
|
"period": r.Period / time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
convertNilToEmptySlice := func(data map[string]interface{}, field string) {
|
convertNilToEmptySlice := func(data map[string]interface{}, field string) {
|
||||||
|
|
|
@ -574,12 +574,12 @@ func TestAwsEc2_RoleCrud(t *testing.T) {
|
||||||
"role_tag": "testtag",
|
"role_tag": "testtag",
|
||||||
"resolve_aws_unique_ids": false,
|
"resolve_aws_unique_ids": false,
|
||||||
"allow_instance_migration": true,
|
"allow_instance_migration": true,
|
||||||
"ttl": "10m",
|
"ttl": "10m",
|
||||||
"max_ttl": "20m",
|
"max_ttl": "20m",
|
||||||
"policies": "testpolicy1,testpolicy2",
|
"policies": "testpolicy1,testpolicy2",
|
||||||
"disallow_reauthentication": false,
|
"disallow_reauthentication": false,
|
||||||
"hmac_key": "testhmackey",
|
"hmac_key": "testhmackey",
|
||||||
"period": "1m",
|
"period": "1m",
|
||||||
}
|
}
|
||||||
|
|
||||||
roleReq.Path = "role/testrole"
|
roleReq.Path = "role/testrole"
|
||||||
|
@ -613,11 +613,11 @@ func TestAwsEc2_RoleCrud(t *testing.T) {
|
||||||
"resolve_aws_unique_ids": false,
|
"resolve_aws_unique_ids": false,
|
||||||
"role_tag": "testtag",
|
"role_tag": "testtag",
|
||||||
"allow_instance_migration": true,
|
"allow_instance_migration": true,
|
||||||
"ttl": time.Duration(600),
|
"ttl": time.Duration(600),
|
||||||
"max_ttl": time.Duration(1200),
|
"max_ttl": time.Duration(1200),
|
||||||
"policies": []string{"testpolicy1", "testpolicy2"},
|
"policies": []string{"testpolicy1", "testpolicy2"},
|
||||||
"disallow_reauthentication": false,
|
"disallow_reauthentication": false,
|
||||||
"period": time.Duration(60),
|
"period": time.Duration(60),
|
||||||
}
|
}
|
||||||
|
|
||||||
if !reflect.DeepEqual(expected, resp.Data) {
|
if !reflect.DeepEqual(expected, resp.Data) {
|
||||||
|
@ -676,9 +676,9 @@ func TestAwsEc2_RoleDurationSeconds(t *testing.T) {
|
||||||
"auth_type": "ec2",
|
"auth_type": "ec2",
|
||||||
"bound_iam_instance_profile_arn": "arn:aws:iam::123456789012:instance-profile/test-profile-name",
|
"bound_iam_instance_profile_arn": "arn:aws:iam::123456789012:instance-profile/test-profile-name",
|
||||||
"resolve_aws_unique_ids": false,
|
"resolve_aws_unique_ids": false,
|
||||||
"ttl": "10s",
|
"ttl": "10s",
|
||||||
"max_ttl": "20s",
|
"max_ttl": "20s",
|
||||||
"period": "30s",
|
"period": "30s",
|
||||||
}
|
}
|
||||||
|
|
||||||
roleReq := &logical.Request{
|
roleReq := &logical.Request{
|
||||||
|
|
|
@ -220,7 +220,7 @@ func TestBackend_PermittedDNSDomainsIntermediateCA(t *testing.T) {
|
||||||
// Sign the intermediate CSR using /pki
|
// Sign the intermediate CSR using /pki
|
||||||
secret, err = client.Logical().Write("pki/root/sign-intermediate", map[string]interface{}{
|
secret, err = client.Logical().Write("pki/root/sign-intermediate", map[string]interface{}{
|
||||||
"permitted_dns_domains": ".myvault.com",
|
"permitted_dns_domains": ".myvault.com",
|
||||||
"csr": intermediateCSR,
|
"csr": intermediateCSR,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
|
@ -104,8 +104,8 @@ func (b *backend) pathConfigRead(ctx context.Context, req *logical.Request, d *f
|
||||||
|
|
||||||
resp := &logical.Response{
|
resp := &logical.Response{
|
||||||
Data: map[string]interface{}{
|
Data: map[string]interface{}{
|
||||||
"host": cfg.Host,
|
"host": cfg.Host,
|
||||||
"port": cfg.Port,
|
"port": cfg.Port,
|
||||||
"unregistered_user_policies": cfg.UnregisteredUserPolicies,
|
"unregistered_user_policies": cfg.UnregisteredUserPolicies,
|
||||||
"dial_timeout": cfg.DialTimeout,
|
"dial_timeout": cfg.DialTimeout,
|
||||||
"read_timeout": cfg.ReadTimeout,
|
"read_timeout": cfg.ReadTimeout,
|
||||||
|
|
|
@ -1961,8 +1961,8 @@ func TestBackend_SignSelfIssued(t *testing.T) {
|
||||||
Subject: pkix.Name{
|
Subject: pkix.Name{
|
||||||
CommonName: "foo.bar.com",
|
CommonName: "foo.bar.com",
|
||||||
},
|
},
|
||||||
SerialNumber: big.NewInt(1234),
|
SerialNumber: big.NewInt(1234),
|
||||||
IsCA: false,
|
IsCA: false,
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1992,8 +1992,8 @@ func TestBackend_SignSelfIssued(t *testing.T) {
|
||||||
Subject: pkix.Name{
|
Subject: pkix.Name{
|
||||||
CommonName: "bar.foo.com",
|
CommonName: "bar.foo.com",
|
||||||
},
|
},
|
||||||
SerialNumber: big.NewInt(2345),
|
SerialNumber: big.NewInt(2345),
|
||||||
IsCA: true,
|
IsCA: true,
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
}
|
}
|
||||||
ss, ssCert := getSelfSigned(template, issuer)
|
ss, ssCert := getSelfSigned(template, issuer)
|
||||||
|
@ -2576,7 +2576,7 @@ func setCerts() {
|
||||||
NotBefore: time.Now().Add(-30 * time.Second),
|
NotBefore: time.Now().Add(-30 * time.Second),
|
||||||
NotAfter: time.Now().Add(262980 * time.Hour),
|
NotAfter: time.Now().Add(262980 * time.Hour),
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
IsCA: true,
|
IsCA: true,
|
||||||
}
|
}
|
||||||
caBytes, err := x509.CreateCertificate(rand.Reader, caCertTemplate, caCertTemplate, cak.Public(), cak)
|
caBytes, err := x509.CreateCertificate(rand.Reader, caCertTemplate, caCertTemplate, cak.Public(), cak)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -82,7 +82,7 @@ func TestBackend_CA_Steps(t *testing.T) {
|
||||||
NotBefore: time.Now().Add(-30 * time.Second),
|
NotBefore: time.Now().Add(-30 * time.Second),
|
||||||
NotAfter: time.Now().Add(262980 * time.Hour),
|
NotAfter: time.Now().Add(262980 * time.Hour),
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
IsCA: true,
|
IsCA: true,
|
||||||
}
|
}
|
||||||
caBytes, err := x509.CreateCertificate(rand.Reader, caCertTemplate, caCertTemplate, cak.Public(), cak)
|
caBytes, err := x509.CreateCertificate(rand.Reader, caCertTemplate, caCertTemplate, cak.Public(), cak)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -506,7 +506,7 @@ func setCerts() {
|
||||||
NotBefore: time.Now().Add(-30 * time.Second),
|
NotBefore: time.Now().Add(-30 * time.Second),
|
||||||
NotAfter: time.Now().Add(262980 * time.Hour),
|
NotAfter: time.Now().Add(262980 * time.Hour),
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
IsCA: true,
|
IsCA: true,
|
||||||
}
|
}
|
||||||
caBytes, err := x509.CreateCertificate(rand.Reader, caCertTemplate, caCertTemplate, caKey.Public(), caKey)
|
caBytes, err := x509.CreateCertificate(rand.Reader, caCertTemplate, caCertTemplate, caKey.Public(), caKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -541,7 +541,7 @@ func setCerts() {
|
||||||
NotBefore: time.Now().Add(-30 * time.Second),
|
NotBefore: time.Now().Add(-30 * time.Second),
|
||||||
NotAfter: time.Now().Add(262980 * time.Hour),
|
NotAfter: time.Now().Add(262980 * time.Hour),
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
IsCA: true,
|
IsCA: true,
|
||||||
}
|
}
|
||||||
intBytes, err := x509.CreateCertificate(rand.Reader, intCertTemplate, caCert, intKey.Public(), caKey)
|
intBytes, err := x509.CreateCertificate(rand.Reader, intCertTemplate, caCert, intKey.Public(), caKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -82,7 +82,7 @@ func TestHandler_cors(t *testing.T) {
|
||||||
"Access-Control-Allow-Origin": addr,
|
"Access-Control-Allow-Origin": addr,
|
||||||
"Access-Control-Allow-Headers": strings.Join(vault.StdAllowedHeaders, ","),
|
"Access-Control-Allow-Headers": strings.Join(vault.StdAllowedHeaders, ","),
|
||||||
"Access-Control-Max-Age": "300",
|
"Access-Control-Max-Age": "300",
|
||||||
"Vary": "Origin",
|
"Vary": "Origin",
|
||||||
}
|
}
|
||||||
|
|
||||||
for expHeader, expected := range expHeaders {
|
for expHeader, expected := range expHeaders {
|
||||||
|
|
|
@ -73,9 +73,9 @@ type AESGCMBarrier struct {
|
||||||
// the provided physical backend for storage.
|
// the provided physical backend for storage.
|
||||||
func NewAESGCMBarrier(physical physical.Backend) (*AESGCMBarrier, error) {
|
func NewAESGCMBarrier(physical physical.Backend) (*AESGCMBarrier, error) {
|
||||||
b := &AESGCMBarrier{
|
b := &AESGCMBarrier{
|
||||||
backend: physical,
|
backend: physical,
|
||||||
sealed: true,
|
sealed: true,
|
||||||
cache: make(map[uint32]cipher.AEAD),
|
cache: make(map[uint32]cipher.AEAD),
|
||||||
currentAESGCMVersionByte: byte(AESGCMVersion2),
|
currentAESGCMVersionByte: byte(AESGCMVersion2),
|
||||||
}
|
}
|
||||||
return b, nil
|
return b, nil
|
||||||
|
|
|
@ -240,7 +240,7 @@ func (c *Core) setupCluster(ctx context.Context) error {
|
||||||
// 30 years of single-active uptime ought to be enough for anybody
|
// 30 years of single-active uptime ought to be enough for anybody
|
||||||
NotAfter: time.Now().Add(262980 * time.Hour),
|
NotAfter: time.Now().Add(262980 * time.Hour),
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
IsCA: true,
|
IsCA: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
certBytes, err := x509.CreateCertificate(rand.Reader, template, template, c.localClusterPrivateKey.Load().(*ecdsa.PrivateKey).Public(), c.localClusterPrivateKey.Load().(*ecdsa.PrivateKey))
|
certBytes, err := x509.CreateCertificate(rand.Reader, template, template, c.localClusterPrivateKey.Load().(*ecdsa.PrivateKey).Public(), c.localClusterPrivateKey.Load().(*ecdsa.PrivateKey))
|
||||||
|
|
|
@ -151,8 +151,8 @@ func TestIdentityStore_EntityCreateUpdate(t *testing.T) {
|
||||||
|
|
||||||
func TestIdentityStore_CloneImmutability(t *testing.T) {
|
func TestIdentityStore_CloneImmutability(t *testing.T) {
|
||||||
alias := &identity.Alias{
|
alias := &identity.Alias{
|
||||||
ID: "testaliasid",
|
ID: "testaliasid",
|
||||||
Name: "testaliasname",
|
Name: "testaliasname",
|
||||||
MergedFromCanonicalIDs: []string{"entityid1"},
|
MergedFromCanonicalIDs: []string{"entityid1"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -311,9 +311,9 @@ func (c *Core) refreshRequestForwardingConnection(ctx context.Context, clusterAd
|
||||||
c.rpcClientConnCancelFunc = cancelFunc
|
c.rpcClientConnCancelFunc = cancelFunc
|
||||||
c.rpcForwardingClient = &forwardingClient{
|
c.rpcForwardingClient = &forwardingClient{
|
||||||
RequestForwardingClient: NewRequestForwardingClient(c.rpcClientConn),
|
RequestForwardingClient: NewRequestForwardingClient(c.rpcClientConn),
|
||||||
core: c,
|
core: c,
|
||||||
echoTicker: time.NewTicker(HeartbeatInterval),
|
echoTicker: time.NewTicker(HeartbeatInterval),
|
||||||
echoContext: dctx,
|
echoContext: dctx,
|
||||||
}
|
}
|
||||||
c.rpcForwardingClient.startHeartbeat()
|
c.rpcForwardingClient.startHeartbeat()
|
||||||
|
|
||||||
|
|
|
@ -952,7 +952,7 @@ func NewTestCluster(t testing.T, base *CoreConfig, opts *TestClusterOptions) *Te
|
||||||
NotBefore: time.Now().Add(-30 * time.Second),
|
NotBefore: time.Now().Add(-30 * time.Second),
|
||||||
NotAfter: time.Now().Add(262980 * time.Hour),
|
NotAfter: time.Now().Add(262980 * time.Hour),
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
IsCA: true,
|
IsCA: true,
|
||||||
}
|
}
|
||||||
caBytes, err = x509.CreateCertificate(rand.Reader, caCertTemplate, caCertTemplate, caKey.Public(), caKey)
|
caBytes, err = x509.CreateCertificate(rand.Reader, caCertTemplate, caCertTemplate, caKey.Public(), caKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue