cd747c9318
Increment a counter whenever a request is received. The in-memory counter is persisted to counters/requests/YYYY/MM. When the month wraps around, we reset the in-memory counter to zero. Add an endpoint for querying the request counters across all time.
44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
// +build !enterprise
|
|
|
|
package vault
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/hashicorp/vault/helper/identity"
|
|
"github.com/hashicorp/vault/logical"
|
|
)
|
|
|
|
func waitForReplicationState(context.Context, *Core, *logical.Request) error { return nil }
|
|
|
|
func checkNeedsCG(context.Context, *Core, *logical.Request, *logical.Auth, error, []string) (error, *logical.Response, *logical.Auth, error) {
|
|
return nil, nil, nil, nil
|
|
}
|
|
|
|
func shouldForward(c *Core, routeErr error) bool {
|
|
return false
|
|
}
|
|
|
|
func syncCounter(c *Core) {
|
|
}
|
|
|
|
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")
|
|
}
|
|
|
|
func getLeaseRegisterFunc(c *Core) (func(context.Context, *logical.Request, *logical.Response) (string, error), error) {
|
|
return c.expiration.Register, nil
|
|
}
|
|
|
|
func getAuthRegisterFunc(c *Core) (RegisterAuthFunc, error) {
|
|
return c.RegisterAuth, nil
|
|
}
|
|
|
|
func possiblyForwardAliasCreation(ctx context.Context, c *Core, inErr error, auth *logical.Auth, entity *identity.Entity) (*identity.Entity, error) {
|
|
return entity, inErr
|
|
}
|