Skip to content

Commit

Permalink
debug -> info on auth/token activity
Browse files Browse the repository at this point in the history
  • Loading branch information
wass3rw3rk committed Jun 20, 2024
1 parent e7d9fd3 commit e1c4e37
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions api/auth/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ func Login(c *gin.Context) {
// default path (headless mode)
path := "/authenticate"

l.Debug("logging in user")
l.Info("logging in user")

// handle web and cli logins
switch t {
case "web":
r = fmt.Sprintf("%s/authenticate/%s", m.Vela.Address, t)

l.Debugf("web login request, setting redirect to: %s", r)
l.Infof("web login request, setting redirect to: %s", r)
case "cli":
// port must be supplied
if len(p) > 0 {
r = fmt.Sprintf("%s/authenticate/%s/%s", m.Vela.Address, t, p)

l.Debugf("cli login request, setting redirect to: %s", r)
l.Infof("cli login request, setting redirect to: %s", r)
}
}

Expand Down
2 changes: 1 addition & 1 deletion api/auth/post_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func PostAuthToken(c *gin.Context) {
return
}

l.Debugf("SCM user %s authenticated using PAT", u.GetName())
l.Infof("SCM user %s authenticated using PAT", u.GetName())

// check if the user exists
u, err = database.FromContext(c).GetUserForName(ctx, u.GetName())
Expand Down
2 changes: 1 addition & 1 deletion api/auth/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
func RefreshAccessToken(c *gin.Context) {
l := c.MustGet("logger").(*logrus.Entry)

l.Debug("refreshing access token")
l.Info("refreshing access token")

// capture the refresh token
// TODO: move this into token package and do it internally
Expand Down
2 changes: 1 addition & 1 deletion api/auth/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func ValidateServerToken(c *gin.Context) {
l := c.MustGet("logger").(*logrus.Entry)
cl := claims.Retrieve(c)

l.Debug("validating server token")
l.Info("validating server token")

if !strings.EqualFold(cl.Subject, "vela-server") {
retErr := fmt.Errorf("token is not a valid server token")
Expand Down
2 changes: 1 addition & 1 deletion api/auth/validate_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func ValidateOAuthToken(c *gin.Context) {
l := c.MustGet("logger").(*logrus.Entry)
ctx := c.Request.Context()

l.Debug("validating oauth token")
l.Info("validating oauth token")

token := c.Request.Header.Get("Token")
if len(token) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion api/build/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func GetBuildToken(c *gin.Context) {
r := repo.Retrieve(c)
cl := claims.Retrieve(c)

l.Debugf("generating build token for build %s/%d", r.GetFullName(), b.GetNumber())
l.Infof("generating build token for build %s/%d", r.GetFullName(), b.GetNumber())

// if build is not in a pending state, then a build token should not be needed - conflict
if !strings.EqualFold(b.GetStatus(), constants.StatusPending) {
Expand Down

0 comments on commit e1c4e37

Please sign in to comment.