Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance(token): add info logging on created private key, debug for minted ID token #1155

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/token/generate_rsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/google/uuid"
"github.com/lestrrat-go/jwx/v2/jwk"
"github.com/sirupsen/logrus"

"github.com/go-vela/server/database"
)
Expand Down Expand Up @@ -54,6 +55,8 @@ func (tm *Manager) GenerateRSA(ctx context.Context, db database.Interface) error

tm.RSAKeySet = keySet

logrus.Infof("generated RSA key pair with kid %s", kid.String())

return nil
default:
return fmt.Errorf("invalid JWK type parsed from generation")
Expand Down
3 changes: 3 additions & 0 deletions internal/token/mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/golang-jwt/jwt/v5"
"github.com/sirupsen/logrus"
"gorm.io/gorm"

api "github.com/go-vela/server/api/types"
Expand Down Expand Up @@ -196,5 +197,7 @@ func (tm *Manager) MintIDToken(ctx context.Context, mto *MintTokenOpts, db datab
return "", fmt.Errorf("unable to sign token: %w", err)
}

logrus.Debugf("signed ID token with subject %s", claims.Subject)

return token, nil
}
Loading