You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require.NoError(t, err, "Failed to establish connection to In a workspace, run `leeway build components/gitpod-db/go:init-testdb` once to bootstrap the ")
40
+
require.NoError(t, err, "Failed to establish connection to In a workspace, run `leeway build components/gitpod-db/go:init-testdb` once to bootstrap the db")
returnnil, connect.NewError(connect.CodeInvalidArgument, errors.New("Received invalid Expiration Time, it is a required parameter."))
165
+
}
166
+
162
167
conn, err:=getConnection(ctx, s.connectionPool)
163
168
iferr!=nil {
164
169
returnnil, err
165
170
}
166
171
167
-
_, _, err=s.getUser(ctx, conn)
172
+
_, userID, err:=s.getUser(ctx, conn)
168
173
iferr!=nil {
169
174
returnnil, err
170
175
}
176
+
pat, err:=auth.GeneratePersonalAccessToken(s.signer)
177
+
iferr!=nil {
178
+
log.WithError(err).Errorf("Failed to regenerate personal access token for user %s", userID.String())
179
+
returnnil, connect.NewError(connect.CodeInternal, errors.New("Failed to regenerate personal access token."))
180
+
}
171
181
172
-
log.Infof("Handling RegeneratePersonalAccessToken request for Token ID '%s'", tokenID.String())
173
-
returnnil, connect.NewError(connect.CodeUnimplemented, errors.New("gitpod.experimental.v1.TokensService.RegeneratePersonalAccessToken is not implemented"))
182
+
hash, err:=pat.ValueHash()
183
+
iferr!=nil {
184
+
log.WithError(err).Errorf("Failed to regenerate personal access token value hash for user %s", userID.String())
185
+
returnnil, connect.NewError(connect.CodeInternal, errors.New("Failed to compute personal access token hash."))
0 commit comments