2023-03-15 19:00:52 +03:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2024-01-02 21:36:20 +03:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-15 19:00:52 +03:00
|
|
|
|
2022-01-05 21:02:03 +03:00
|
|
|
//go:build !enterprise
|
2018-09-18 06:03:00 +03:00
|
|
|
|
|
|
|
package vault
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-02-04 17:10:35 +03:00
|
|
|
"sync"
|
2023-01-24 22:00:27 +03:00
|
|
|
"time"
|
2018-09-18 06:03:00 +03:00
|
|
|
|
|
|
|
"github.com/hashicorp/vault/helper/identity"
|
2019-04-13 00:54:35 +03:00
|
|
|
"github.com/hashicorp/vault/sdk/logical"
|
2018-09-18 06:03:00 +03:00
|
|
|
)
|
|
|
|
|
2021-02-04 17:10:35 +03:00
|
|
|
func waitForReplicationState(context.Context, *Core, *logical.Request) (*sync.WaitGroup, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
2018-09-18 06:03:00 +03:00
|
|
|
|
|
|
|
func checkNeedsCG(context.Context, *Core, *logical.Request, *logical.Auth, error, []string) (error, *logical.Response, *logical.Auth, error) {
|
|
|
|
return nil, nil, nil, nil
|
|
|
|
}
|
|
|
|
|
2019-04-04 00:16:49 +03:00
|
|
|
func checkErrControlGroupTokenNeedsCreated(err error) bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2019-07-06 01:12:34 +03:00
|
|
|
func shouldForward(c *Core, resp *logical.Response, err error) bool {
|
2019-03-05 22:55:07 +03:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2021-02-25 23:27:25 +03:00
|
|
|
func syncCounters(c *Core) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func syncBarrierEncryptionCounter(c *Core) error {
|
|
|
|
return nil
|
2019-03-05 22:55:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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 06:03:00 +03:00
|
|
|
}
|
|
|
|
|
2022-07-05 20:02:00 +03:00
|
|
|
func getLeaseRegisterFunc(c *Core) (func(context.Context, *logical.Request, *logical.Response, string) (string, error), error) {
|
2018-09-18 06:03:00 +03:00
|
|
|
return c.expiration.Register, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func getAuthRegisterFunc(c *Core) (RegisterAuthFunc, error) {
|
|
|
|
return c.RegisterAuth, nil
|
|
|
|
}
|
|
|
|
|
2022-12-07 04:22:46 +03:00
|
|
|
func getUserFailedLoginInfo(ctx context.Context, c *Core, userInfo FailedLoginUser) (*FailedLoginInfo, error) {
|
2023-05-31 20:51:20 +03:00
|
|
|
return c.LocalGetUserFailedLoginInfo(ctx, userInfo), nil
|
2022-11-16 02:07:52 +03:00
|
|
|
}
|
|
|
|
|
2022-12-07 04:22:46 +03:00
|
|
|
func updateUserFailedLoginInfo(ctx context.Context, c *Core, userInfo FailedLoginUser, failedLoginInfo *FailedLoginInfo, deleteEntry bool) error {
|
2023-05-31 20:51:20 +03:00
|
|
|
return c.LocalUpdateUserFailedLoginInfo(ctx, userInfo, failedLoginInfo, deleteEntry)
|
2022-11-16 02:07:52 +03:00
|
|
|
}
|
|
|
|
|
2022-05-18 19:16:13 +03:00
|
|
|
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 06:03:00 +03:00
|
|
|
}
|
2021-10-15 22:20:00 +03: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-05-17 23:30:36 +03:00
|
|
|
|
2022-07-21 20:53:42 +03:00
|
|
|
func updateLocalAlias(ctx context.Context, c *Core, auth *logical.Auth, entity *identity.Entity) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-05-17 23:30:36 +03:00
|
|
|
func possiblyForwardSaveCachedAuthResponse(ctx context.Context, c *Core, respAuth *MFACachedAuthResponse) error {
|
|
|
|
err := c.SaveMFAResponseAuth(respAuth)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
2023-01-24 22:00:27 +03:00
|
|
|
|
|
|
|
func forwardCreateTokenRegisterAuth(ctx context.Context, c *Core, te *logical.TokenEntry, roleName string, renewable bool, periodToUse, explicitMaxTTLToUse time.Duration) (*logical.TokenEntry, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|