cffa353ffb
Also: - Add CSS to login page - Refactor login page HTML and CSS into a new package - New custom CSP headers for the login page, because the requirements are different from the form_post page
16 lines
379 B
Go
16 lines
379 B
Go
// Copyright 2022 the Pinniped contributors. All Rights Reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Package csp defines helpers related to HTML Content Security Policies.
|
|
package csp
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"encoding/base64"
|
|
)
|
|
|
|
func Hash(s string) string {
|
|
hashBytes := sha256.Sum256([]byte(s))
|
|
return "sha256-" + base64.StdEncoding.EncodeToString(hashBytes[:])
|
|
}
|