summaryrefslogtreecommitdiff
path: root/internal/util/util.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-02-06 14:44:18 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-02-19 14:15:07 +0100
commit4d26c8489b09acc98128715e9a2ed67558eb8105 (patch)
tree0ed8f4c95c12e501bc1a78c646c707ed6618936b /internal/util/util.go
parent3fd29f3e1c963196cac69fcbb9d68116f7ea80ec (diff)
Util + OAuth: Delete internal OAuth implementation
Preparing to move to github.com/jwijenbergh/eduoauth-go
Diffstat (limited to 'internal/util/util.go')
-rw-r--r--internal/util/util.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/internal/util/util.go b/internal/util/util.go
index 85c4b37..97b4151 100644
--- a/internal/util/util.go
+++ b/internal/util/util.go
@@ -2,23 +2,12 @@
package util
import (
- "crypto/rand"
"fmt"
"net/url"
"os"
"strings"
)
-// MakeRandomByteSlice creates a cryptographically random bytes slice of `size`
-// It returns the byte slice (or nil if error) and an error if it could not be generated.
-func MakeRandomByteSlice(n int) ([]byte, error) {
- bs := make([]byte, n)
- if _, err := rand.Read(bs); err != nil {
- return nil, errors.WrapPrefix(err, "failed reading random", 0)
- }
- return bs, nil
-}
-
// EnsureDirectory creates a directory with permission 700.
func EnsureDirectory(dir string) error {
// Create with 700 permissions, read, write, execute only for the owner