open-vault/vault/request_handling_util.go

91 lines
2.6 KiB
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
//go:build !enterprise
2018-09-18 03:03:00 +00:00
package vault
import (
"context"
"sync"
"time"
2018-09-18 03:03:00 +00:00
"github.com/hashicorp/vault/helper/identity"
"github.com/hashicorp/vault/sdk/logical"
2018-09-18 03:03:00 +00:00
)
func waitForReplicationState(context.Context, *Core, *logical.Request) (*sync.WaitGroup, error) {
return nil, nil
}
2018-09-18 03:03:00 +00:00
func checkNeedsCG(context.Context, *Core, *logical.Request, *logical.Auth, error, []string) (error, *logical.Response, *logical.Auth, error) {
return nil, nil, nil, nil
}
func checkErrControlGroupTokenNeedsCreated(err error) bool {
return false
}
func shouldForward(c *Core, resp *logical.Response, err error) bool {
return false
}
func syncCounters(c *Core) error {
return nil
}
func syncBarrierEncryptionCounter(c *Core) error {
return nil
}
func couldForward(c *Core) bool {
return false
}
func forward(ctx context.Context, c *Core, req *logical.Request) (*logical.Response, error) {
panic("forward called in OSS Vault")
2018-09-18 03:03:00 +00:00
}
func getLeaseRegisterFunc(c *Core) (func(context.Context, *logical.Request, *logical.Response, string) (string, error), error) {
2018-09-18 03:03:00 +00:00
return c.expiration.Register, nil
}
func getAuthRegisterFunc(c *Core) (RegisterAuthFunc, error) {
return c.RegisterAuth, nil
}
func getUserFailedLoginInfo(ctx context.Context, c *Core, userInfo FailedLoginUser) (*FailedLoginInfo, error) {
return c.GetUserFailedLoginInfo(ctx, userInfo), nil
}
func updateUserFailedLoginInfo(ctx context.Context, c *Core, userInfo FailedLoginUser, failedLoginInfo *FailedLoginInfo, deleteEntry bool) error {
return c.UpdateUserFailedLoginInfo(ctx, userInfo, failedLoginInfo, deleteEntry)
}
func possiblyForwardAliasCreation(ctx context.Context, c *Core, inErr error, auth *logical.Auth, entity *identity.Entity) (*identity.Entity, bool, error) {
return entity, false, inErr
2018-09-18 03:03:00 +00:00
}
var errCreateEntityUnimplemented = "create entity unimplemented in the server"
func possiblyForwardEntityCreation(ctx context.Context, c *Core, inErr error, auth *logical.Auth, entity *identity.Entity) (*identity.Entity, error) {
return entity, inErr
}
2022-07-21 17:53:42 +00:00
func updateLocalAlias(ctx context.Context, c *Core, auth *logical.Auth, entity *identity.Entity) error {
return nil
}
func possiblyForwardSaveCachedAuthResponse(ctx context.Context, c *Core, respAuth *MFACachedAuthResponse) error {
err := c.SaveMFAResponseAuth(respAuth)
if err != nil {
return err
}
return nil
}
func forwardCreateTokenRegisterAuth(ctx context.Context, c *Core, te *logical.TokenEntry, roleName string, renewable bool, periodToUse, explicitMaxTTLToUse time.Duration) (*logical.TokenEntry, error) {
return nil, nil
}