func RemoveSecrets(
	credential Credential,
	schemas map[AuthType]CredentialSchema,
) (*Credential, error) {
	schema, ok := schemas[credential.authType]
	if !ok {
		return nil, errors.NotSupportedf("auth-type %q", credential.authType)
	}
	redactedAttrs := credential.Attributes()
	for _, attr := range schema {
		if attr.Hidden {
			delete(redactedAttrs, attr.Name)
		}
	}
	return &Credential{authType: credential.authType, attributes: redactedAttrs}, nil
}
// RemoveSecrets returns a copy of the given credential with secret fields removed.
RemoveSecrets returns a copy of the given credential with secret fields removed.
// RemoveSecrets returns a copy of the given credential with secret fields removed .
func RemoveSecrets(
	credential Credential,
	schemas map[AuthType]CredentialSchema,
) (*Credential, error) {
	schema, ok := schemas[credential.authType]
	if !ok {
		return nil, errors.NotSupportedf("auth-type %q", credential.authType)
	}
	redactedAttrs := credential.Attributes()
	for _, attr := range schema {
		if attr.Hidden {
			delete(redactedAttrs, attr.Name)
		}
	}
	return &Credential{authType: credential.authType, attributes: redactedAttrs}, nil
}
func RemoveSecrets ( credential Credential , schemas map [ AuthType ] CredentialSchema , ) ( * Credential , error ) { schema , ok := schemas [ credential . authType ] if ! ok { return nil , errors . NotSupportedf ( " " , credential . authType ) } redactedAttrs := credential . Attributes ( ) for _ , attr := range schema { if attr . Hidden { delete ( redactedAttrs , attr . Name ) } } return & Credential { authType : credential . authType , attributes : redactedAttrs } , nil }
RemoveSecrets returns a copy of the given credential with secret fields removed.
RemoveSecrets returns a copy of the given credential with secret fields removed .