Skip to content

Commit

Permalink
fix: removed snyk issues involving OIDC
Browse files Browse the repository at this point in the history
  • Loading branch information
pacificcode committed Aug 7, 2024
1 parent 7020029 commit 6f26958
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,6 @@ snapcraft-login

# mac
.DS_Store

# snyk
.dccache
5 changes: 1 addition & 4 deletions auth/method_oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ func (a *authenticator) buildOIDCParams(at AuthType, provider string, callback s
// handleOidcAuth handles OIDC and Thycotic One auths.
func handleOidcAuth(at AuthType, doneCh chan<- authResponse) http.HandlerFunc {
return func(w http.ResponseWriter, req *http.Request) {
b, err := io.ReadAll(req.Body)
_, err := io.ReadAll(req.Body)
if err != nil {
w.Write([]byte(err.Error()))
doneCh <- authResponse{err: fmt.Errorf("reading body: %w", err)}
}

Expand All @@ -116,14 +115,12 @@ func handleOidcAuth(at AuthType, doneCh chan<- authResponse) http.HandlerFunc {
doneCh <- authResponse{
err: errors.New("missing values in callback, authorization code is empty"),
}
w.Write(b)
return
}
if state == "" {
doneCh <- authResponse{
err: errors.New("missing values in callback, authorization state is empty"),
}
w.Write(b)
return
}

Expand Down
2 changes: 1 addition & 1 deletion cicd-integration/generate_pki.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func generateRootWithPrivateKey() ([]byte, []byte, error) {
}

func generateCSR() ([]byte, error) {
keyBytes, _ := rsa.GenerateKey(rand.Reader, 1024)
keyBytes, _ := rsa.GenerateKey(rand.Reader, 2048)

Check warning on line 55 in cicd-integration/generate_pki.go

View workflow job for this annotation

GitHub Actions / Trunk Check

golangci-lint(revive)

[new] add-constant: avoid magic numbers like '2048', create a named constant for it

subj := pkix.Name{
CommonName: leafCommonName,
Expand Down

0 comments on commit 6f26958

Please sign in to comment.