Revert "CC-796: Remove dependency on unsupported version of go-oidc"

This reverts commit 0899d6a136.
This commit is contained in:
João Oliveirinha
2022-03-17 22:34:35 +00:00
parent 398cc8b134
commit 05b903a32e
37 changed files with 905 additions and 1146 deletions

View File

@@ -23,12 +23,13 @@ import (
"encoding/binary"
"io"
"math/big"
"strings"
"unicode"
"regexp"
"gopkg.in/square/go-jose.v2/json"
)
var stripWhitespaceRegex = regexp.MustCompile("\\s")
// Helper function to serialize known-good objects.
// Precondition: value is not a nil pointer.
func mustSerializeJSON(value interface{}) []byte {
@@ -55,14 +56,7 @@ func mustSerializeJSON(value interface{}) []byte {
// Strip all newlines and whitespace
func stripWhitespace(data string) string {
buf := strings.Builder{}
buf.Grow(len(data))
for _, r := range data {
if !unicode.IsSpace(r) {
buf.WriteRune(r)
}
}
return buf.String()
return stripWhitespaceRegex.ReplaceAllString(data, "")
}
// Perform compression based on algorithm