Skip to content

Commit b92b44e

Browse files
committed
fmt
1 parent 0728b95 commit b92b44e

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

components/public-api-server/pkg/apiv1/oidc.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (s *OIDCService) CreateClientConfig(ctx context.Context, req *connect.Reque
9090
}
9191

9292
log.AddFields(ctx, logrus.Fields{
93-
"oidc_client_config_id": created.ID.String(),
93+
"oidcClientConfigId": created.ID.String(),
9494
})
9595

9696
converted, err := dbOIDCClientConfigToAPI(created, s.cipher)
@@ -248,9 +248,7 @@ func (s *OIDCService) getUser(ctx context.Context, conn protocol.APIInterface) (
248248
}
249249

250250
log.AddFields(ctx, logrus.Fields{
251-
"user.id": user.ID,
252-
"user.blocked": user.Blocked,
253-
"user.prividged": user.Privileged,
251+
"userId": user.ID,
254252
})
255253

256254
if !s.isFeatureEnabled(ctx, conn, user) {

components/public-api-server/pkg/apiv1/team.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func (s *TeamService) DeleteTeamMember(ctx context.Context, req *connect.Request
270270
}
271271

272272
func (s *TeamService) toTeamAPIResponse(ctx context.Context, conn protocol.APIInterface, team *protocol.Team) (*v1.Team, error) {
273-
logger := log.Extract(ctx).WithField("team.id", team.ID)
273+
logger := log.Extract(ctx).WithField("teamId", team.ID)
274274
members, err := conn.GetTeamMembers(ctx, team.ID)
275275
if err != nil {
276276
logger.WithError(err).Error("Failed to get team members.")

components/public-api-server/pkg/apiv1/tokens.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,7 @@ func (s *TokensService) getUser(ctx context.Context, conn protocol.APIInterface)
303303
}
304304

305305
log.AddFields(ctx, logrus.Fields{
306-
"user.id": user.ID,
307-
"user.blocked": user.Blocked,
308-
"user.prividged": user.Privileged,
306+
"userId": user.ID,
309307
})
310308

311309
if !s.isFeatureEnabled(ctx, conn, user) {

components/public-api-server/pkg/apiv1/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (s *UserService) GetAuthenticatedUser(ctx context.Context, req *connect.Req
4141
return nil, proxy.ConvertError(err)
4242
}
4343
log.AddFields(ctx, logrus.Fields{
44-
"user.id": user.ID,
44+
"userId": user.ID,
4545
})
4646

4747
response := userToAPIResponse(user)

components/public-api-server/pkg/apiv1/validation.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
func validateTeamID(ctx context.Context, id string) (uuid.UUID, error) {
2525
log.AddFields(ctx, logrus.Fields{
26-
"team.id": id,
26+
"teamId": id,
2727
})
2828
teamID, err := validateUUID(id)
2929
if err != nil {
@@ -51,7 +51,7 @@ func parseGitpodTimestamp(input string) (*timestamppb.Timestamp, error) {
5151

5252
func validateWorkspaceID(ctx context.Context, id string) (string, error) {
5353
log.AddFields(ctx, logrus.Fields{
54-
"workspace.id": id,
54+
"workspaceId": id,
5555
})
5656
if id == "" {
5757
return "", connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("Empty workspace id specified"))
@@ -67,7 +67,7 @@ func validateWorkspaceID(ctx context.Context, id string) (string, error) {
6767

6868
func validateProjectID(ctx context.Context, id string) (uuid.UUID, error) {
6969
log.AddFields(ctx, logrus.Fields{
70-
"project.id": id,
70+
"projectId": id,
7171
})
7272
projectID, err := validateUUID(id)
7373
if err != nil {
@@ -79,7 +79,7 @@ func validateProjectID(ctx context.Context, id string) (uuid.UUID, error) {
7979

8080
func validatePersonalAccessTokenID(ctx context.Context, id string) (uuid.UUID, error) {
8181
log.AddFields(ctx, logrus.Fields{
82-
"pat.id": id,
82+
"patId": id,
8383
})
8484
tokenID, err := validateUUID(id)
8585
if err != nil {
@@ -100,7 +100,7 @@ func validateOrganizationID(ctx context.Context, id string) (uuid.UUID, error) {
100100
}
101101

102102
func validateOIDCClientConfigID(ctx context.Context, id string) (uuid.UUID, error) {
103-
log.AddFields(ctx, logrus.Fields{"oidc_client_cfg.id": id})
103+
log.AddFields(ctx, logrus.Fields{"oidcClientConfigId": id})
104104
oidcClientConfigID, err := validateUUID(id)
105105
if err != nil {
106106
return uuid.Nil, connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("OIDC Client Config ID must be a valid UUID"))

components/public-api-server/pkg/server/logs.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package server
66

77
import (
88
"context"
9+
910
"github.com/gitpod-io/gitpod/common-go/log"
1011

1112
"github.com/bufbuild/connect-go"
@@ -18,24 +19,24 @@ func NewLogInterceptor(entry *logrus.Entry) connect.UnaryInterceptorFunc {
1819
ctx = log.ToContext(ctx, entry.WithContext(ctx))
1920

2021
log.AddFields(ctx, logrus.Fields{
21-
"request.protocol": "connect",
22-
"request.procedure": req.Spec().Procedure,
23-
"address": req.Peer().Addr,
24-
"request.stream_type": streamType(req.Spec().StreamType),
25-
"request.headers": req.Header(),
22+
"requestProtocol": "connect",
23+
"requestProcedure": req.Spec().Procedure,
24+
"address": req.Peer().Addr,
25+
"requestStreamType": streamType(req.Spec().StreamType),
26+
"requestHeaders": req.Header(),
2627
})
2728
log.Extract(ctx).Debugf("Handling request for %s", req.Spec().Procedure)
2829

2930
resp, err := next(ctx, req)
3031

3132
// Retrieve the logger from the context again, in case it's been updated.
3233
code := codeOf(err)
33-
log.AddFields(ctx, logrus.Fields{"response.code": code})
34+
log.AddFields(ctx, logrus.Fields{"responseCode": code})
3435

3536
if err != nil {
3637
log.AddFields(ctx, logrus.Fields{logrus.ErrorKey: err})
3738
} else {
38-
log.AddFields(ctx, logrus.Fields{"response.body": resp.Any()})
39+
log.AddFields(ctx, logrus.Fields{"responseBody": resp.Any()})
3940
}
4041

4142
if req.Spec().IsClient {

0 commit comments

Comments
 (0)