chore: upgrade gofumpt to v0.3.1 (#2028)
This commit is contained in:
13 files changed
+34
-17
No files matched your search
@@ -49,7 +49,8 @@ func Callback(
|
||||
iamRepoFn IamRepoFactory,
|
||||
atRepoFn AuthTokenRepoFactory,
|
||||
am *AuthMethod,
|
||||
state, code string) (finalRedirect string, e error) {
|
||||
state, code string,
|
||||
) (finalRedirect string, e error) {
|
||||
const op = "oidc.Callback"
|
||||
if oidcRepoFn == nil {
|
||||
return "", errors.New(ctx, errors.InvalidParameter, op, "missing oidc repository function")
|
||||
|
||||
@@ -46,7 +46,8 @@ func TestAuthMethod(
|
||||
state AuthMethodState,
|
||||
clientId string,
|
||||
clientSecret ClientSecret,
|
||||
opt ...Option) *AuthMethod {
|
||||
opt ...Option,
|
||||
) *AuthMethod {
|
||||
t.Helper()
|
||||
ctx := context.TODO()
|
||||
opts := getOpts(opt...)
|
||||
|
||||
@@ -38,7 +38,8 @@ func testVaultToken(t *testing.T,
|
||||
v *TestVaultServer,
|
||||
cs *CredentialStore,
|
||||
status TokenStatus,
|
||||
expiration time.Duration) *Token {
|
||||
expiration time.Duration,
|
||||
) *Token {
|
||||
t.Helper()
|
||||
assert, require := assert.New(t), require.New(t)
|
||||
kmsCache := kms.TestKms(t, conn, wrapper)
|
||||
@@ -93,7 +94,8 @@ func testVaultCred(t *testing.T,
|
||||
sess *session.Session,
|
||||
token *Token,
|
||||
status CredentialStatus,
|
||||
expiration time.Duration) (*vault.Secret, *Credential) {
|
||||
expiration time.Duration,
|
||||
) (*vault.Secret, *Credential) {
|
||||
t.Helper()
|
||||
assert, require := assert.New(t), require.New(t)
|
||||
rw := db.New(conn)
|
||||
|
||||
@@ -66,7 +66,6 @@ func SetColumns(names []string) []ColumnValue {
|
||||
// OnConflict specifies how to handle alternative actions to take when an insert
|
||||
// results in a unique constraint or exclusion constraint error.
|
||||
type OnConflict struct {
|
||||
|
||||
// Target specifies what conflict you want to define a policy for. This can
|
||||
// be any one of these:
|
||||
// Columns: the name of a specific column or columns
|
||||
|
||||
@@ -314,7 +314,8 @@ func (r *SetSyncJob) upsertAndCleanHosts(
|
||||
hc *HostCatalog,
|
||||
setIds []string,
|
||||
phs []*plgpb.ListHostsResponseHost,
|
||||
_ ...Option) ([]*Host, error) {
|
||||
_ ...Option,
|
||||
) ([]*Host, error) {
|
||||
const op = "plugin.(SetSyncJob).upsertAndCleanHosts"
|
||||
for _, ph := range phs {
|
||||
if ph.GetExternalId() == "" {
|
||||
|
||||
@@ -111,7 +111,8 @@ func NewVerifierContext(ctx context.Context,
|
||||
authTokenRepoFn common.AuthTokenRepoFactory,
|
||||
serversRepoFn common.ServersRepoFactory,
|
||||
kms *kms.Kms,
|
||||
requestInfo *authpb.RequestInfo) context.Context {
|
||||
requestInfo *authpb.RequestInfo,
|
||||
) context.Context {
|
||||
return context.WithValue(ctx, verifierKey, &verifier{
|
||||
iamRepoFn: iamRepoFn,
|
||||
authTokenRepoFn: authTokenRepoFn,
|
||||
@@ -439,7 +440,8 @@ func (v verifier) performAuthCheck(ctx context.Context) (
|
||||
scopeInfo *scopes.ScopeInfo,
|
||||
retAcl perms.ACL,
|
||||
grantTuples []perms.GrantTuple,
|
||||
retErr error) {
|
||||
retErr error,
|
||||
) {
|
||||
const op = "auth.(verifier).performAuthCheck"
|
||||
// Ensure we return an error by default if we forget to set this somewhere
|
||||
retErr = errors.New(ctx, errors.Unknown, op, "default auth error", errors.WithoutEvent())
|
||||
|
||||
@@ -19,7 +19,8 @@ import (
|
||||
func CalculateAuthorizedCollectionActions(ctx context.Context,
|
||||
authResults VerifyResults,
|
||||
mapToRange map[resource.Type]action.ActionSet,
|
||||
scopeId, pin string) (map[string]*structpb.ListValue, error) {
|
||||
scopeId, pin string,
|
||||
) (map[string]*structpb.ListValue, error) {
|
||||
res := &perms.Resource{
|
||||
ScopeId: scopeId,
|
||||
Pin: pin,
|
||||
|
||||
@@ -39,7 +39,8 @@ func GetListingScopeIds(
|
||||
recursive bool,
|
||||
// Whether to only return scopes with exact permissions, or whether parent
|
||||
// scopes with appropriate permissions are sufficient
|
||||
directOnly bool) ([]string, map[string]*scopes.ScopeInfo, error) {
|
||||
directOnly bool,
|
||||
) ([]string, map[string]*scopes.ScopeInfo, error) {
|
||||
const op = "GetListingScopeIds"
|
||||
|
||||
// Validation
|
||||
|
||||
@@ -75,7 +75,8 @@ func requestCtxInterceptor(
|
||||
return func(interceptorCtx context.Context,
|
||||
req interface{},
|
||||
_ *grpc.UnaryServerInfo,
|
||||
handler grpc.UnaryHandler) (interface{}, error) {
|
||||
handler grpc.UnaryHandler,
|
||||
) (interface{}, error) {
|
||||
md, ok := metadata.FromIncomingContext(interceptorCtx)
|
||||
if !ok {
|
||||
return nil, errors.New(interceptorCtx, errors.Internal, op, "No metadata")
|
||||
@@ -279,7 +280,8 @@ func workerRequestInfoInterceptor(ctx context.Context, eventer *event.Eventer) (
|
||||
return func(interceptorCtx context.Context,
|
||||
req interface{},
|
||||
srvInfo *grpc.UnaryServerInfo,
|
||||
handler grpc.UnaryHandler) (interface{}, error) {
|
||||
handler grpc.UnaryHandler,
|
||||
) (interface{}, error) {
|
||||
var err error
|
||||
id, err := event.NewId(event.IdPrefix)
|
||||
if err != nil {
|
||||
|
||||
@@ -13,7 +13,8 @@ import (
|
||||
// * The session has not reached its connection limit or has a connection limit of -1.
|
||||
// If any of these criteria is not met, it returns an error with Code InvalidSessionState.
|
||||
func AuthorizeConnection(ctx context.Context, sessionRepoFn *Repository, connectionRepoFn *ConnectionRepository,
|
||||
sessionId, workerId string, opt ...Option) (*Connection, []*ConnectionState, *AuthzSummary, error) {
|
||||
sessionId, workerId string, opt ...Option,
|
||||
) (*Connection, []*ConnectionState, *AuthzSummary, error) {
|
||||
const op = "session.AuthorizeConnection"
|
||||
|
||||
connection, connectionStates, err := connectionRepoFn.AuthorizeConnection(ctx, sessionId, workerId)
|
||||
|
||||
@@ -10,7 +10,8 @@ import (
|
||||
// * closes requested connections
|
||||
// * uses the sessionId of the connection to see if the session meets conditions for termination
|
||||
func CloseConnections(ctx context.Context, sessionRepoFn *Repository, connectionRepoFn *ConnectionRepository,
|
||||
closeWiths []CloseWith) ([]closeConnectionResp, error) {
|
||||
closeWiths []CloseWith,
|
||||
) ([]closeConnectionResp, error) {
|
||||
const op = "session.AuthorizeConnection"
|
||||
|
||||
closeInfos, err := connectionRepoFn.closeConnections(ctx, closeWiths)
|
||||
|
||||
Reference in new issue
Block a user