Release / update-version (push) Has been cancelled
Release / build-frontend (push) Has been cancelled
Release / release (push) Has been cancelled
Release / sync-version-file (push) Has been cancelled
CI / shell (push) Canceled after 0s
CI / test (push) Canceled after 0s
CI / frontend (push) Canceled after 0s
CI / golangci-lint (push) Canceled after 0s
Security Scan / backend-security (push) Canceled after 0s
Security Scan / frontend-security (push) Canceled after 0s
22 lines
767 B
Go
22 lines
767 B
Go
package service
|
|
|
|
// SanitizeStoredCredentials strips secrets that must never be persisted on the
|
|
// account credentials map after conversion to OAuth tokens (Grok Web SSO / password).
|
|
// Call from admin create/update/import/apply-oauth paths.
|
|
//
|
|
// Cookie is always stripped: bulk paths may pass an empty platform label, and
|
|
// session-jar residue must never sit next to OAuth tokens on any platform.
|
|
// The platform argument is retained for call-site clarity / future scrubbing.
|
|
func SanitizeStoredCredentials(platform string, creds map[string]any) map[string]any {
|
|
if creds == nil {
|
|
return nil
|
|
}
|
|
_ = platform
|
|
for _, key := range []string{
|
|
"password", "sso_token", "sso", "sso-rw", "clearTextPassword", "cookie",
|
|
} {
|
|
delete(creds, key)
|
|
}
|
|
return creds
|
|
}
|