03806629b8
We opened https://github.com/vmware-tanzu/pinniped/issues/254 for the TODO in dynamicOpenIDConnectECDSAStrategy.GenerateToken(). This commit also ensures that linting and unit tests are passing again. Signed-off-by: Andrew Keesler <akeesler@vmware.com>
16 lines
371 B
Go
16 lines
371 B
Go
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package testutil
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"encoding/base64"
|
|
)
|
|
|
|
// SHA256 returns the base64 URL encoding of the SHA256 sum of the provided string.
|
|
func SHA256(s string) string {
|
|
b := sha256.Sum256([]byte(s))
|
|
return base64.RawURLEncoding.EncodeToString(b[:])
|
|
}
|