@@ -51,13 +51,11 @@ func NewService(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HashToken creates a FIPS 140 compliant SHA-256 hash of the token
|
|
||||||
func HashToken(token string) []byte {
|
func HashToken(token string) []byte {
|
||||||
hash := sha256.Sum256([]byte(token))
|
hash := sha256.Sum256([]byte(token))
|
||||||
return hash[:]
|
return hash[:]
|
||||||
}
|
}
|
||||||
|
|
||||||
// GenerateToken creates a cryptographically secure random token
|
|
||||||
func GenerateToken() (string, error) {
|
func GenerateToken() (string, error) {
|
||||||
bytes := make([]byte, 32)
|
bytes := make([]byte, 32)
|
||||||
if _, err := rand.Read(bytes); err != nil {
|
if _, err := rand.Read(bytes); err != nil {
|
||||||
@@ -592,7 +590,6 @@ func ParseUserFromAttributes(attributes scim.ResourceAttributes) *User {
|
|||||||
Emails: []Email{
|
Emails: []Email{
|
||||||
{
|
{
|
||||||
Value: email,
|
Value: email,
|
||||||
Type: "work",
|
|
||||||
Primary: true,
|
Primary: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user