Files
threshold/internal/auth/oidc/client_secret.go
T
dd0f34bc35 Add new OIDC auth method. (#1090)
Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2021-04-08 20:54:32 -04:00

23 lines
616 B
Go

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
}
// MarshalJSON will redact the client_secret.
func (s ClientSecret) MarshalJSON() ([]byte, error) {
return json.Marshal(redactedClientSecret)
}