mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-10 16:47:01 +02:00
chore: fix function names (#26087)
Signed-off-by: depthlending <bikangning@outlook.com> Co-authored-by: Chris Capurso <1036769+ccapurso@users.noreply.github.com>
This commit is contained in:
parent
f7301bc5fa
commit
f8ad26c89f
@ -26,8 +26,8 @@ func (b bufCloser) Close() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GenerateForwardedRequest generates a new http.Request that contains the
|
// GenerateForwardedHTTPRequest generates a new http.Request that contains the
|
||||||
// original requests's information in the new request's body.
|
// original request's information in the new request's body.
|
||||||
func GenerateForwardedHTTPRequest(req *http.Request, addr string) (*http.Request, error) {
|
func GenerateForwardedHTTPRequest(req *http.Request, addr string) (*http.Request, error) {
|
||||||
fq, err := GenerateForwardedRequest(req)
|
fq, err := GenerateForwardedRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -101,7 +101,7 @@ func GenerateForwardedRequest(req *http.Request) (*Request, error) {
|
|||||||
return &fq, nil
|
return &fq, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseForwardedRequest generates a new http.Request that is comprised of the
|
// ParseForwardedHTTPRequest generates a new http.Request that is comprised of the
|
||||||
// values in the given request's body, assuming it correctly parses into a
|
// values in the given request's body, assuming it correctly parses into a
|
||||||
// ForwardedRequest.
|
// ForwardedRequest.
|
||||||
func ParseForwardedHTTPRequest(req *http.Request) (*http.Request, error) {
|
func ParseForwardedHTTPRequest(req *http.Request) (*http.Request, error) {
|
||||||
|
@ -76,8 +76,8 @@ func IsCurrentMonth(t, compare time.Time) bool {
|
|||||||
return queryMonthStart.Equal(thisMonthStart)
|
return queryMonthStart.Equal(thisMonthStart)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMostRecentContinuousMonths finds the start time of the most
|
// GetMostRecentContiguousMonths finds the start time of the most
|
||||||
// recent set of continguous months.
|
// recent set of continuous months.
|
||||||
//
|
//
|
||||||
// For example, if the most recent start time is Aug 15, then that range is just 1 month
|
// For example, if the most recent start time is Aug 15, then that range is just 1 month
|
||||||
// If the recent start times are Aug 1 and July 1 and June 15, then that range is
|
// If the recent start times are Aug 1 and July 1 and June 15, then that range is
|
||||||
|
@ -147,7 +147,7 @@ func setUserLockoutValueAllInMap(userLockoutAll *UserLockout) *UserLockout {
|
|||||||
return setNilValuesForRawUserLockoutFields(userLockoutAll)
|
return setNilValuesForRawUserLockoutFields(userLockoutAll)
|
||||||
}
|
}
|
||||||
|
|
||||||
// setDefaultUserLockoutValuesInMap sets missing user lockout fields for auth methods
|
// setMissingUserLockoutValuesInMap sets missing user lockout fields for auth methods
|
||||||
// with default values (from key "all") that are not configured using config file
|
// with default values (from key "all") that are not configured using config file
|
||||||
func setMissingUserLockoutValuesInMap(userLockoutsMap map[string]*UserLockout) map[string]*UserLockout {
|
func setMissingUserLockoutValuesInMap(userLockoutsMap map[string]*UserLockout) map[string]*UserLockout {
|
||||||
// set values for "all" key with default values for "all" user lockout fields that are not configured
|
// set values for "all" key with default values for "all" user lockout fields that are not configured
|
||||||
|
@ -149,7 +149,7 @@ func (f *BoltSnapshotStore) List() ([]*raft.SnapshotMeta, error) {
|
|||||||
return []*raft.SnapshotMeta{meta}, nil
|
return []*raft.SnapshotMeta{meta}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// getBoltSnapshotMeta returns the fsm's latest state and configuration.
|
// getMetaFromFSM returns the fsm's latest state and configuration.
|
||||||
func (f *BoltSnapshotStore) getMetaFromFSM() (*raft.SnapshotMeta, error) {
|
func (f *BoltSnapshotStore) getMetaFromFSM() (*raft.SnapshotMeta, error) {
|
||||||
latestIndex, latestConfig := f.fsm.LatestState()
|
latestIndex, latestConfig := f.fsm.LatestState()
|
||||||
meta := &raft.SnapshotMeta{
|
meta := &raft.SnapshotMeta{
|
||||||
|
@ -66,7 +66,7 @@ func isEd25519OID(oid asn1.ObjectIdentifier) bool {
|
|||||||
return oidNSSPKIXEd25519.Equal(oid) || oidRFC8410Ed25519.Equal(oid)
|
return oidNSSPKIXEd25519.Equal(oid) || oidRFC8410Ed25519.Equal(oid)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParsePKCS8PrivateKey parses an unencrypted private key in PKCS #8, ASN.1 DER form.
|
// ParsePKCS8Ed25519PrivateKey parses an unencrypted private key in PKCS #8, ASN.1 DER form.
|
||||||
//
|
//
|
||||||
// It returns a *rsa.PrivateKey, a *ecdsa.PrivateKey, or a ed25519.PrivateKey.
|
// It returns a *rsa.PrivateKey, a *ecdsa.PrivateKey, or a ed25519.PrivateKey.
|
||||||
// More types might be supported in the future.
|
// More types might be supported in the future.
|
||||||
@ -121,7 +121,7 @@ func ParsePKCS8Ed25519PrivateKey(der []byte) (key interface{}, err error) {
|
|||||||
return ed25519.NewKeyFromSeed(ed25519Key.PrivateKey), nil
|
return ed25519.NewKeyFromSeed(ed25519Key.PrivateKey), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParsePKCS8PrivateKey parses an unencrypted private key in PKCS #8, ASN.1 DER form.
|
// ParsePKCS8RSAPSSPrivateKey parses an unencrypted private key in PKCS #8, ASN.1 DER form.
|
||||||
//
|
//
|
||||||
// This helper only supports RSA/PSS keys (with OID 1.2.840.113549.1.1.10).
|
// This helper only supports RSA/PSS keys (with OID 1.2.840.113549.1.1.10).
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user