Add codespell job (#1281)

add codespell workflow and fixed spelling issues
This commit is contained in:
Maycon Santos
2023-11-07 13:37:57 +01:00
committed by GitHub
parent 125a7a9daf
commit b726b3262d
15 changed files with 42 additions and 28 deletions

View File

@@ -251,7 +251,7 @@ func TestAccountManager_GetOrCreateAccountByUser(t *testing.T) {
}
if account != nil && account.Users[userID] == nil {
t.Fatalf("expected to create an account for a user %s but no user was found after creation udner the account %s", userID, account.Id)
t.Fatalf("expected to create an account for a user %s but no user was found after creation under the account %s", userID, account.Id)
return
}
@@ -626,7 +626,7 @@ func TestAccountManager_PrivateAccount(t *testing.T) {
}
if account != nil && account.Users[userId] == nil {
t.Fatalf("expected to create an account for a user %s but no user was found after creation udner the account %s", userId, account.Id)
t.Fatalf("expected to create an account for a user %s but no user was found after creation under the account %s", userId, account.Id)
}
}
@@ -1385,7 +1385,7 @@ func TestAccount_Copy(t *testing.T) {
if err != nil {
t.Fatal(err)
}
account.Peers["peer1"].Status.Connected = false // we change original object to confirm that copy wont change
account.Peers["peer1"].Status.Connected = false // we change original object to confirm that copy won't change
accCopyBytes, err := json.Marshal(accountCopy)
if err != nil {
t.Fatal(err)

View File

@@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
)
func newTestRequestWithJWT(t *testing.T, claims AuthorizationClaims, audiance string) *http.Request {
func newTestRequestWithJWT(t *testing.T, claims AuthorizationClaims, audience string) *http.Request {
const layout = "2006-01-02T15:04:05.999Z"
claimMaps := jwt.MapClaims{}
@@ -18,16 +18,16 @@ func newTestRequestWithJWT(t *testing.T, claims AuthorizationClaims, audiance st
claimMaps[UserIDClaim] = claims.UserId
}
if claims.AccountId != "" {
claimMaps[audiance+AccountIDSuffix] = claims.AccountId
claimMaps[audience+AccountIDSuffix] = claims.AccountId
}
if claims.Domain != "" {
claimMaps[audiance+DomainIDSuffix] = claims.Domain
claimMaps[audience+DomainIDSuffix] = claims.Domain
}
if claims.DomainCategory != "" {
claimMaps[audiance+DomainCategorySuffix] = claims.DomainCategory
claimMaps[audience+DomainCategorySuffix] = claims.DomainCategory
}
if claims.LastLogin != (time.Time{}) {
claimMaps[audiance+LastLoginSuffix] = claims.LastLogin.Format(layout)
claimMaps[audience+LastLoginSuffix] = claims.LastLogin.Format(layout)
}
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claimMaps)
r, err := http.NewRequest(http.MethodGet, "http://localhost", nil)