Skip to content

Commit

Permalink
reverts
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed May 1, 2024
1 parent dbbd307 commit d62fb00
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 74 deletions.
2 changes: 1 addition & 1 deletion auth/services/selfsigned/test/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func Test_GenerateTestData(t *testing.T) {
createdTime := time.Date(2023, 4, 20, 9, 53, 3, 0, time.UTC)
expirationTime := createdTime.Add(4 * 24 * time.Hour)

// WithParam up crypto
// Set up crypto
const keyID = "did:nuts:8NYzfsndZJHh6GqzKiSBpyERrFxuX64z6tE5raa7nEjm#bYcuet6EHojMlaMqwNoC3c6etKlUHoJ9rRvUu3ZKEEw"
privateKeyData, err := os.ReadFile("private.pem")
require.NoError(t, err)
Expand Down
6 changes: 3 additions & 3 deletions crypto/cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func newRootCommand() *cobra.Command {
}

func Test_fs2VaultCommand(t *testing.T) {
// WithParam up webserver that stubs Vault
// Set up webserver that stubs Vault
importRequests := make(map[string]string, 0)
s := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
data, err := io.ReadAll(request.Body)
Expand Down Expand Up @@ -124,7 +124,7 @@ func Test_fs2VaultCommand(t *testing.T) {
func Test_fs2ExternalStore(t *testing.T) {
// tests imports 1 new key, skips a known one, and the server returns an error for the third one
t.Run("ok", func(t *testing.T) {
// WithParam up webserver that stubs Vault
// Set up webserver that stubs Vault
importRequests := make(map[string]string, 0)

s := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
Expand Down Expand Up @@ -186,7 +186,7 @@ func setupFSStoreData(t *testing.T, testDirectory string) {
t.Helper()
ctx := context.Background()

// WithParam up crypto filesystem with some keys
// Set up crypto filesystem with some keys
pk1, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
pk2, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
pk3, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
Expand Down
2 changes: 1 addition & 1 deletion discovery/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (r *defaultClientRegistrationManager) activate(ctx context.Context, service
}
log.Logger().Debugf("Successfully registered Verifiable Presentation on Discovery Service (service=%s, did=%s)", serviceID, subjectDID)

// WithParam presentation to be refreshed before it expires
// Set presentation to be refreshed before it expires
// TODO: When to refresh? For now, we refresh when the registration is about to expire (75% of max age)
refreshVPAfter := time.Now().Add(time.Duration(float64(service.PresentationMaxValidity)*0.75) * time.Second)
if err := r.store.updatePresentationRefreshTime(serviceID, subjectDID, &refreshVPAfter); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion discovery/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func (s *sqlStore) updateTag(tx *gorm.DB, serviceID string, newTimestamp Tag) (*
result = &ts
service.LastTag = ts.Tag(service.TagPrefix)
} else {
// WithParam tag: just store it
// Set tag: just store it
service.LastTag = newTimestamp
}
if err := tx.Save(service).Error; err != nil {
Expand Down
2 changes: 1 addition & 1 deletion http/echo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func Test_MultiEcho(t *testing.T) {

const defaultAddress = ":1323"

// WithParam up expected echo servers
// Set up expected echo servers
defaultServer := NewMockEchoServer(ctrl)
defaultServer.EXPECT().Add("PATCH", "/other/default-endpoint", gomock.Any())
defaultServer.EXPECT().Start(defaultAddress)
Expand Down
2 changes: 1 addition & 1 deletion http/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ func generateEd25519TestKey(t *testing.T) (jwk.Key, *jwt.Serializer, []byte) {
jwkKey, err := jwk.FromRaw(priv)
require.NoError(t, err)

// WithParam the key ID for the jwk to be the public key fingerprint
// Set the key ID for the jwk to be the public key fingerprint
err = jwkKey.Set(jwk.KeyIDKey, ssh.FingerprintSHA256(sshPub))
require.NoError(t, err)

Expand Down
4 changes: 2 additions & 2 deletions http/tokenV2/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func accessGranted(authKey authorizedKey, context echo.Context, token jwt.Token,
auditLog := auditLogger(context, token.Subject(), audit.AccessGrantedEvent)
auditLog.Infof("Access granted to user '%v' with JWT %s issued to %s by %s", authKey.comment, token.JwtID(), token.Subject(), token.Issuer())

// WithParam the username from authorized_keys as the username in the context
// Set the username from authorized_keys as the username in the context
context.Set(core.UserContextKey, token.Issuer())

// Call the next handler/middleware, probably serving some content/processing the API request
Expand Down Expand Up @@ -402,7 +402,7 @@ func unauthorizedError(context echo.Context, reason error) *echo.HTTPError {
// set the error writer to the unauthorized error writer so the error response follow the default control logic
context.Set(core.ErrorWriterContextKey, &unauthorizedErrorWriter{})

// WithParam an empty username for this context
// Set an empty username for this context
context.Set(core.UserContextKey, "")

// Log an entry in the audit log about this failure
Expand Down
Loading

0 comments on commit d62fb00

Please sign in to comment.