Files
threshold/internal/auth/oidc/client_secret.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
804 B
Go
Raw Normal View History

2023-02-02 17:15:17 -08:00
// Copyright (c) HashiCorp, Inc.
2021-04-08 20:54:32 -04:00
// SPDX-License-Identifier: BUSL-1.1
2023-02-02 17:15:17 -08:00
2021-04-08 20:54:32 -04:00
package oidc
import (
"encoding/json"
)
// ClientSecret equals an AuthMethod's client secret. This type provides a
// wrapper so the secret isn't inadvertently leaked into a log or error.
type ClientSecret string
// RedactedClientSecret is the redacted string or json for an oidc id_token.
const redactedClientSecret = "[REDACTED: OIDC client_secret]"
// String will redact the client_secret.
func (s ClientSecret) String() string {
return redactedClientSecret
}
2021-06-16 11:44:08 -07:00
// GoString will redact the client_secret.
func (s ClientSecret) GoString() string {
return redactedClientSecret
}
2021-04-08 20:54:32 -04:00
// MarshalJSON will redact the client_secret.
func (s ClientSecret) MarshalJSON() ([]byte, error) {
return json.Marshal(redactedClientSecret)
}