diff --git a/.secrets.baseline b/.secrets.baseline index e614f322c..4990d5592 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -105,12 +105,6 @@ }, { "path": "detect_secrets.filters.heuristic.is_templated_secret" - }, - { - "path": "detect_secrets.filters.regex.should_exclude_file", - "pattern": [ - "go.sum" - ] } ], "results": { @@ -138,7 +132,7 @@ "filename": "core/auth/apis.go", "hashed_secret": "394e3412459f79523e12e1fa95a4cf141ccff122", "is_verified": false, - "line_number": 2096 + "line_number": 2100 } ], "core/auth/auth.go": [ @@ -147,28 +141,28 @@ "filename": "core/auth/auth.go", "hashed_secret": "417355fe2b66baa6826739a6d8006ab2ddcf5186", "is_verified": false, - "line_number": 154 + "line_number": 151 }, { "type": "Secret Keyword", "filename": "core/auth/auth.go", - "hashed_secret": "bbdb97274c94b9605a766e317fca26186c34c510", + "hashed_secret": "a358987289cd70bbf50fb10acbcb9bff73c66df6", "is_verified": false, - "line_number": 156 + "line_number": 153 }, { "type": "Secret Keyword", "filename": "core/auth/auth.go", "hashed_secret": "58f3388441fbce0e48aef2bf74413a6f43f6dc70", "is_verified": false, - "line_number": 936 + "line_number": 937 }, { "type": "Secret Keyword", "filename": "core/auth/auth.go", "hashed_secret": "94a7f0195bbbd2260c4e4d02b6348fbcd90b2b30", "is_verified": false, - "line_number": 2442 + "line_number": 2441 } ], "core/auth/auth_type_email.go": [ @@ -366,5 +360,5 @@ } ] }, - "generated_at": "2023-07-11T15:43:42Z" + "generated_at": "2023-10-06T19:34:36Z" } diff --git a/core/auth/apis.go b/core/auth/apis.go index 3514ea42e..1dfc49b59 100644 --- a/core/auth/apis.go +++ b/core/auth/apis.go @@ -54,7 +54,7 @@ func (a *Auth) GetHost() string { // ipAddress (string): Client's IP address // deviceType (string): "mobile" or "web" or "desktop" etc // deviceOS (*string): Device OS -// deviceID (string): Device ID +// deviceID (*string): Device ID // authenticationType (string): Name of the authentication method for provided creds (eg. "email", "username", "illinois_oidc") // creds (string): Credentials/JSON encoded credential structure defined for the specified auth type // apiKey (string): API key to validate the specified app @@ -74,14 +74,14 @@ func (a *Auth) GetHost() string { // Params (interface{}): authType-specific set of parameters passed back to client // State (string): login state used if account is enrolled in MFA // MFA types ([]model.MFAType): list of MFA types account is enrolled in -func (a *Auth) Login(ipAddress string, deviceType string, deviceOS *string, deviceID string, authenticationType string, creds string, apiKey string, +func (a *Auth) Login(ipAddress string, deviceType string, deviceOS *string, deviceID *string, authenticationType string, creds string, apiKey string, appTypeIdentifier string, orgID string, params string, clientVersion *string, profile model.Profile, privacy model.Privacy, preferences map[string]interface{}, username string, admin bool, l *logs.Log) (*string, *model.LoginSession, []model.MFAType, error) { //TODO - analyse what should go in one transaction //validate if the provided auth type is supported by the provided application and organization authType, appType, appOrg, err := a.validateAuthType(authenticationType, appTypeIdentifier, orgID) - if err != nil { + if err != nil || authType == nil { return nil, nil, nil, errors.WrapErrorAction(logutils.ActionValidate, model.TypeAuthType, nil, err) } @@ -98,6 +98,8 @@ func (a *Auth) Login(ipAddress string, deviceType string, deviceOS *string, devi return nil, nil, nil, errors.WrapErrorData(logutils.StatusInvalid, model.TypeAPIKey, nil, err) } + username = strings.TrimSpace(strings.ToLower(username)) + anonymous := false sub := "" @@ -127,7 +129,6 @@ func (a *Auth) Login(ipAddress string, deviceType string, deviceOS *string, devi accountAuthType, responseParams, mfaTypes, externalIDs, err = a.applyExternalAuthType(*authType, *appType, *appOrg, creds, params, clientVersion, profile, privacy, preferences, username, admin, l) if err != nil { return nil, nil, nil, errors.WrapErrorAction(logutils.ActionApply, typeExternalAuthType, logutils.StringArgs("user"), err) - } sub = accountAuthType.Account.ID @@ -942,6 +943,7 @@ func (a *Auth) UpdateCredential(accountID string, accountAuthTypeID string, para if err != nil || authTypeCreds == nil { return errors.WrapErrorAction(logutils.ActionValidate, "reset password", nil, err) } + //Update the credential with new password credential.Value = authTypeCreds if err = a.storage.UpdateCredential(nil, credential); err != nil { @@ -1008,7 +1010,7 @@ func (a *Auth) ResetForgotCredential(credsID string, resetCode string, params st func (a *Auth) ForgotCredential(authenticationType string, appTypeIdentifier string, orgID string, apiKey string, identifier string, l *logs.Log) error { //validate if the provided auth type is supported by the provided application and organization authType, _, appOrg, err := a.validateAuthType(authenticationType, appTypeIdentifier, orgID) - if err != nil { + if err != nil || authType == nil || appOrg == nil { return errors.WrapErrorAction(logutils.ActionValidate, model.TypeAuthType, nil, err) } @@ -1061,6 +1063,7 @@ func (a *Auth) ForgotCredential(authenticationType string, appTypeIdentifier str if err != nil || authTypeCreds == nil { return errors.WrapErrorAction(logutils.ActionValidate, "forgot password", nil, err) } + //Update the credential with reset code and expiry credential.Value = authTypeCreds if err = a.storage.UpdateCredential(nil, credential); err != nil { @@ -1073,7 +1076,7 @@ func (a *Auth) ForgotCredential(authenticationType string, appTypeIdentifier str func (a *Auth) SendVerifyCredential(authenticationType string, appTypeIdentifier string, orgID string, apiKey string, identifier string, l *logs.Log) error { //validate if the provided auth type is supported by the provided application and organization authType, _, appOrg, err := a.validateAuthType(authenticationType, appTypeIdentifier, orgID) - if err != nil { + if err != nil || authType == nil || appOrg == nil { return errors.WrapErrorAction(logutils.ActionValidate, model.TypeAuthType, nil, err) } //validate api key before making db calls @@ -1085,6 +1088,7 @@ func (a *Auth) SendVerifyCredential(authenticationType string, appTypeIdentifier if !authType.UseCredentials { return errors.ErrorData(logutils.StatusInvalid, model.TypeAuthType, logutils.StringArgs("credential verification code")) } + authImpl, err := a.getAuthTypeImpl(*authType) if err != nil { return errors.WrapErrorAction(logutils.ActionLoadCache, model.TypeAuthType, nil, err) @@ -1696,7 +1700,7 @@ func (a *Auth) LinkAccountAuthType(accountID string, authenticationType string, //validate if the provided auth type is supported by the provided application and organization authType, appType, appOrg, err := a.validateAuthType(authenticationType, appTypeIdentifier, account.AppOrg.Organization.ID) - if err != nil { + if err != nil || authType == nil || appType == nil || appOrg == nil { return nil, nil, errors.WrapErrorAction(logutils.ActionValidate, model.TypeAuthType, nil, err) } diff --git a/core/auth/auth.go b/core/auth/auth.go index 713068581..73f19a837 100644 --- a/core/auth/auth.go +++ b/core/auth/auth.go @@ -34,7 +34,6 @@ import ( "github.com/rokwire/core-auth-library-go/v3/tokenauth" "golang.org/x/sync/syncmap" "gopkg.in/go-playground/validator.v9" - "gopkg.in/gomail.v2" "github.com/rokwire/logging-library-go/v2/errors" "github.com/rokwire/logging-library-go/v2/logs" @@ -107,9 +106,6 @@ type Auth struct { profileBB ProfileBuildingBlock identityBB IdentityBuildingBlock - emailFrom string - emailDialer *gomail.Dialer - cachedIdentityProviders *syncmap.Map //cache identityProviders identityProvidersLock *sync.RWMutex @@ -119,11 +115,14 @@ type Auth struct { //delete sessions timer deleteSessionsTimer *time.Timer deleteSessionsTimerDone chan bool + + version string } // NewAuth creates a new auth instance -func NewAuth(serviceID string, host string, authPrivKey *keys.PrivKey, authService *authservice.AuthService, storage Storage, emailer Emailer, minTokenExp *int64, maxTokenExp *int64, supportLegacySigs bool, twilioAccountSID string, - twilioToken string, twilioServiceSID string, profileBB ProfileBuildingBlock, smtpHost string, smtpPortNum int, smtpUser string, smtpPassword string, smtpFrom string, logger *logs.Logger) (*Auth, error) { +func NewAuth(serviceID string, host string, authPrivKey *keys.PrivKey, authService *authservice.AuthService, storage Storage, emailer Emailer, minTokenExp *int64, + maxTokenExp *int64, supportLegacySigs bool, twilioAccountSID string, twilioToken string, twilioServiceSID string, profileBB ProfileBuildingBlock, + smtpHost string, smtpPortNum int, smtpUser string, smtpPassword string, smtpFrom string, logger *logs.Logger, version string) (*Auth, error) { if minTokenExp == nil { var minTokenExpVal int64 = 5 minTokenExp = &minTokenExpVal @@ -133,8 +132,6 @@ func NewAuth(serviceID string, host string, authPrivKey *keys.PrivKey, authServi var maxTokenExpVal int64 = 60 maxTokenExp = &maxTokenExpVal } - //maybe set up from config collection for diff types of auth - emailDialer := gomail.NewDialer(smtpHost, smtpPortNum, smtpUser, smtpPassword) authTypes := map[string]authType{} externalAuthTypes := map[string]externalAuthType{} @@ -153,7 +150,7 @@ func NewAuth(serviceID string, host string, authPrivKey *keys.PrivKey, authServi auth := &Auth{storage: storage, emailer: emailer, logger: logger, authTypes: authTypes, externalAuthTypes: externalAuthTypes, anonymousAuthTypes: anonymousAuthTypes, serviceAuthTypes: serviceAuthTypes, mfaTypes: mfaTypes, authPrivKey: authPrivKey, ServiceRegManager: nil, serviceID: serviceID, host: host, minTokenExp: *minTokenExp, maxTokenExp: *maxTokenExp, profileBB: profileBB, cachedIdentityProviders: cachedIdentityProviders, identityProvidersLock: identityProvidersLock, - apiKeys: apiKeys, apiKeysLock: apiKeysLock, deleteSessionsTimerDone: deleteSessionsTimerDone, emailDialer: emailDialer, emailFrom: smtpFrom} + apiKeys: apiKeys, apiKeysLock: apiKeysLock, deleteSessionsTimerDone: deleteSessionsTimerDone, version: version} err := auth.storeCoreRegs() if err != nil { @@ -178,7 +175,7 @@ func NewAuth(serviceID string, host string, authPrivKey *keys.PrivKey, authServi auth.SignatureAuth = signatureAuth - //Initialize auth types + // auth types initUsernameAuth(auth) initEmailAuth(auth) initPhoneAuth(auth, twilioAccountSID, twilioToken, twilioServiceSID) @@ -186,12 +183,15 @@ func NewAuth(serviceID string, host string, authPrivKey *keys.PrivKey, authServi initAnonymousAuth(auth) initSignatureAuth(auth) + // external auth types initOidcAuth(auth) initSamlAuth(auth) + // service auth types initStaticTokenServiceAuth(auth) initSignatureServiceAuth(auth) + // mfa types initTotpMfa(auth) initEmailMfa(auth) initPhoneMfa(auth) @@ -638,8 +638,8 @@ func (a *Auth) applyAuthType(authType model.AuthType, appOrg model.ApplicationOr } if isSignUp { if admin { - - return "", nil, nil, nil, errors.ErrorData(logutils.StatusInvalid, "sign up", &logutils.FieldArgs{"identifier": userIdentifier, "auth_type": authType.Code, "app_org_id": appOrg.ID, "admin": true}).SetStatus(utils.ErrorStatusNotAllowed) + return "", nil, nil, nil, errors.ErrorData(logutils.StatusInvalid, "sign up", &logutils.FieldArgs{"identifier": userIdentifier, + "auth_type": authType.Code, "app_org_id": appOrg.ID, "admin": true}).SetStatus(utils.ErrorStatusNotAllowed) } message, accountAuthType, err := a.applySignUp(authImpl, account, authType, appOrg, userIdentifier, creds, params, clientVersion, regProfile, privacy, regPreferences, username, l) @@ -682,9 +682,10 @@ func (a *Auth) checkCredentialVerified(authImpl authType, accountAuthType *model if err != nil { return errors.WrapErrorAction(logutils.ActionVerify, "credential verified", nil, err) } + if !*verified { //it is unverified - if !*expired { + if expired == nil || !*expired { //not expired, just notify the client that it is "unverified" return errors.ErrorData("unverified", "credential", nil).SetStatus(utils.ErrorStatusUnverified) } @@ -1025,7 +1026,7 @@ func (a *Auth) findAccountAuthType(account *model.Account, authType *model.AuthT if accountAuthType.Credential != nil { //populate credentials in accountAuthType credential, err := a.storage.FindCredential(nil, accountAuthType.Credential.ID) - if err != nil { + if err != nil || credential == nil { return nil, errors.WrapErrorAction(logutils.ActionFind, model.TypeCredential, nil, err) } credential.AuthType = *authType @@ -1106,7 +1107,7 @@ func (a *Auth) clearExpiredSessions(identifier string, l *logs.Log) error { func (a *Auth) applyLogin(anonymous bool, sub string, authType model.AuthType, appOrg model.ApplicationOrganization, accountAuthType *model.AccountAuthType, appType model.ApplicationType, externalIDs map[string]string, ipAddress string, deviceType string, - deviceOS *string, deviceID string, clientVersion *string, params map[string]interface{}, state string, l *logs.Log) (*model.LoginSession, error) { + deviceOS *string, deviceID *string, clientVersion *string, params map[string]interface{}, state string, l *logs.Log) (*model.LoginSession, error) { var err error var loginSession *model.LoginSession @@ -1186,7 +1187,7 @@ func (a *Auth) applyLogin(anonymous bool, sub string, authType model.AuthType, a return loginSession, nil } -func (a *Auth) createDevice(accountID string, deviceType string, deviceOS *string, deviceID string, l *logs.Log) (*model.Device, error) { +func (a *Auth) createDevice(accountID string, deviceType string, deviceOS *string, deviceID *string, l *logs.Log) (*model.Device, error) { //id idUUID, _ := uuid.NewUUID() id := idUUID.String() @@ -1627,8 +1628,7 @@ func (a *Auth) linkAccountAuthType(account model.Account, authType model.AuthTyp } } - credentialID, _ := uuid.NewUUID() - credID := credentialID.String() + credID := uuid.NewString() //apply sign up message, credentialValue, err := authImpl.signUp(authType, appOrg, creds, params, credID, l) @@ -2061,7 +2061,6 @@ func (a *Auth) validateAuthType(authenticationType string, appTypeIdentifier str applicationType, err := a.storage.FindApplicationType(appTypeIdentifier) if err != nil { return nil, nil, nil, errors.WrapErrorAction(logutils.ActionFind, model.TypeApplicationType, logutils.StringArgs(appTypeIdentifier), err) - } if applicationType == nil { return nil, nil, nil, errors.ErrorData(logutils.StatusMissing, model.TypeApplicationType, logutils.StringArgs(appTypeIdentifier)) diff --git a/core/auth/auth_type_oidc.go b/core/auth/auth_type_oidc.go index 7179aabaa..d8109b7b1 100644 --- a/core/auth/auth_type_oidc.go +++ b/core/auth/auth_type_oidc.go @@ -387,7 +387,6 @@ func (a *oidcAuthImpl) loadOidcTokenWithParams(params map[string]string, oidcCon "Content-Length": strconv.Itoa(len(data.Encode())), } - client := &http.Client{} req, err := http.NewRequest(http.MethodPost, tokenURI, strings.NewReader(data.Encode())) if err != nil { return nil, errors.WrapErrorAction(logutils.ActionCreate, logutils.TypeRequest, nil, err) @@ -395,6 +394,8 @@ func (a *oidcAuthImpl) loadOidcTokenWithParams(params map[string]string, oidcCon for k, v := range headers { req.Header.Set(k, v) } + + client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, errors.WrapErrorAction(logutils.ActionSend, logutils.TypeRequest, nil, err) @@ -434,13 +435,13 @@ func (a *oidcAuthImpl) loadOidcUserInfo(token *oidcToken, url string) ([]byte, e return nil, errors.ErrorData(logutils.StatusMissing, "user info url", nil) } - client := &http.Client{} req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return nil, errors.WrapErrorAction(logutils.ActionCreate, logutils.TypeRequest, nil, err) } req.Header.Set("Authorization", fmt.Sprintf("%s %s", token.TokenType, token.AccessToken)) + client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, errors.WrapErrorAction(logutils.ActionSend, logutils.TypeRequest, nil, err) @@ -518,7 +519,7 @@ func initOidcAuth(auth *Auth) (*oidcAuthImpl, error) { err := auth.registerExternalAuthType(oidc.authType, oidc) if err != nil { - return nil, errors.WrapErrorAction(logutils.ActionRegister, model.TypeAuthType, nil, err) + return nil, errors.WrapErrorAction(logutils.ActionRegister, typeExternalAuthType, nil, err) } return oidc, nil diff --git a/core/auth/auth_type_phone.go b/core/auth/auth_type_phone.go index 336847397..d663b86d6 100644 --- a/core/auth/auth_type_phone.go +++ b/core/auth/auth_type_phone.go @@ -12,20 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Copyright 2022 Board of Trustees of the University of Illinois. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - package auth import ( diff --git a/core/auth/auth_type_saml.go b/core/auth/auth_type_saml.go index 593b0e1b3..853f83f8e 100644 --- a/core/auth/auth_type_saml.go +++ b/core/auth/auth_type_saml.go @@ -51,7 +51,7 @@ func initSamlAuth(auth *Auth) (*samlAuthImpl, error) { err := auth.registerExternalAuthType(saml.authType, saml) if err != nil { - return nil, errors.WrapErrorAction(logutils.ActionRegister, model.TypeAuthType, nil, err) + return nil, errors.WrapErrorAction(logutils.ActionRegister, typeExternalAuthType, nil, err) } return saml, nil diff --git a/core/auth/interfaces.go b/core/auth/interfaces.go index fc10f6323..229dc44e8 100644 --- a/core/auth/interfaces.go +++ b/core/auth/interfaces.go @@ -122,7 +122,7 @@ type APIs interface { // ipAddress (string): Client's IP address // deviceType (string): "mobile" or "web" or "desktop" etc // deviceOS (*string): Device OS - // deviceID (string): Device ID + // deviceID (*string): Device ID // authenticationType (string): Name of the authentication method for provided creds (eg. "email", "username", "illinois_oidc") // creds (string): Credentials/JSON encoded credential structure defined for the specified auth type // apiKey (string): API key to validate the specified app @@ -143,7 +143,7 @@ type APIs interface { // Params (interface{}): authType-specific set of parameters passed back to client // State (string): login state used if account is enrolled in MFA // MFA types ([]model.MFAType): list of MFA types account is enrolled in - Login(ipAddress string, deviceType string, deviceOS *string, deviceID string, authenticationType string, creds string, apiKey string, + Login(ipAddress string, deviceType string, deviceOS *string, deviceID *string, authenticationType string, creds string, apiKey string, appTypeIdentifier string, orgID string, params string, clientVersion *string, profile model.Profile, privacy model.Privacy, preferences map[string]interface{}, username string, admin bool, l *logs.Log) (*string, *model.LoginSession, []model.MFAType, error) @@ -562,7 +562,7 @@ type Storage interface { FindApplicationOrganization(appID string, orgID string) (*model.ApplicationOrganization, error) //Device - FindDevice(context storage.TransactionContext, deviceID string, accountID string) (*model.Device, error) + FindDevice(context storage.TransactionContext, deviceID *string, accountID string) (*model.Device, error) InsertDevice(context storage.TransactionContext, device model.Device) (*model.Device, error) DeleteDevice(context storage.TransactionContext, id string) error diff --git a/core/model/auth.go b/core/model/auth.go index 5124e6649..03f59d03c 100644 --- a/core/model/auth.go +++ b/core/model/auth.go @@ -25,9 +25,9 @@ import ( ) const ( - //TypeLoginSession auth type type + //TypeLoginSession login session type TypeLoginSession logutils.MessageDataType = "login session" - //TypeAuthType auth type type + //TypeAuthType auth type TypeAuthType logutils.MessageDataType = "auth type" //TypeIdentityProvider identity provider type TypeIdentityProvider logutils.MessageDataType = "identity provider" diff --git a/core/model/user.go b/core/model/user.go index 1d5d1979e..e96973c1d 100644 --- a/core/model/user.go +++ b/core/model/user.go @@ -561,7 +561,7 @@ func ProfileFromMap(profileMap map[string]interface{}) Profile { type Device struct { ID string - DeviceID string //provided by client + DeviceID *string //provided by client Account Account Type string //mobile, web, desktop, other diff --git a/driven/storage/adapter.go b/driven/storage/adapter.go index a093dc791..2088075ad 100644 --- a/driven/storage/adapter.go +++ b/driven/storage/adapter.go @@ -444,14 +444,18 @@ func (sa *Adapter) setCachedAuthTypes(authProviders []model.AuthType) { err := validate.Struct(authType) if err == nil { //we will get it by id and code as well - sa.cachedAuthTypes.Store(authType.ID, authType) - sa.cachedAuthTypes.Store(authType.Code, authType) + sa.setCachedAuthType(authType) } else { sa.logger.Errorf("failed to validate and cache auth type with code %s: %s", authType.Code, err.Error()) } } } +func (sa *Adapter) setCachedAuthType(authType model.AuthType) { + sa.cachedAuthTypes.Store(authType.ID, authType) + sa.cachedAuthTypes.Store(authType.Code, authType) +} + func (sa *Adapter) getCachedAuthType(key string) (*model.AuthType, error) { sa.authTypesLock.RLock() defer sa.authTypesLock.RUnlock() @@ -3738,11 +3742,14 @@ func (sa *Adapter) UpdateApplicationOrganization(context TransactionContext, app } // FindDevice finds a device by device id and account id -func (sa *Adapter) FindDevice(context TransactionContext, deviceID string, accountID string) (*model.Device, error) { - filter := bson.D{primitive.E{Key: "device_id", Value: deviceID}, - primitive.E{Key: "account_id", Value: accountID}} - var result []device +func (sa *Adapter) FindDevice(context TransactionContext, deviceID *string, accountID string) (*model.Device, error) { + filter := bson.D{primitive.E{Key: "account_id", Value: accountID}} + if deviceID != nil { + filter = append(filter, primitive.E{Key: "device_id", Value: *deviceID}) + } + + var result []device err := sa.db.devices.FindWithContext(context, filter, &result, nil) if err != nil { return nil, errors.WrapErrorAction(logutils.ActionFind, model.TypeDevice, nil, err) @@ -3786,6 +3793,7 @@ func (sa *Adapter) InsertDevice(context TransactionContext, device model.Device) // InsertAuthType inserts an auth type func (sa *Adapter) InsertAuthType(context TransactionContext, authType model.AuthType) (*model.AuthType, error) { + sa.setCachedAuthType(authType) _, err := sa.db.authTypes.InsertOneWithContext(context, authType) if err != nil { return nil, errors.WrapErrorAction(logutils.ActionInsert, model.TypeAuthType, nil, err) diff --git a/driven/storage/model_user.go b/driven/storage/model_user.go index 495f9d07b..05000b739 100644 --- a/driven/storage/model_user.go +++ b/driven/storage/model_user.go @@ -106,7 +106,7 @@ type profile struct { type userDevice struct { ID string `bson:"_id"` - DeviceID string `bson:"device_id"` + DeviceID *string `bson:"device_id"` Type string `bson:"type"` OS string `bson:"os"` @@ -118,8 +118,8 @@ type userDevice struct { type device struct { ID string `bson:"_id"` - DeviceID string `bson:"device_id"` - Account string `bson:"account_id"` + DeviceID *string `bson:"device_id"` + Account string `bson:"account_id"` Type string `bson:"type"` OS string `bson:"os"` diff --git a/driver/web/adapter.go b/driver/web/adapter.go index a3f44182d..f970bf0cf 100644 --- a/driver/web/adapter.go +++ b/driver/web/adapter.go @@ -396,11 +396,14 @@ func (we Adapter) wrapFunc(handler handlerFunc, authorization tokenauth.Handler) //1. validate request var response logs.HTTPResponse - requestValidationInput, err := we.validateRequest(req) - if err != nil { - response = logObj.HTTPResponseErrorAction(logutils.ActionValidate, logutils.TypeRequest, nil, err, http.StatusBadRequest, true) - we.completeResponse(w, response, logObj) - return + var requestValidationInput *openapi3filter.RequestValidationInput + if we.env == "local" { + requestValidationInput, err = we.validateRequest(req) + if err != nil { + response = logObj.HTTPResponseErrorAction(logutils.ActionValidate, logutils.TypeRequest, nil, err, http.StatusBadRequest, true) + we.completeResponse(w, response, logObj) + return + } } //2. process it @@ -419,7 +422,7 @@ func (we Adapter) wrapFunc(handler handlerFunc, authorization tokenauth.Handler) } //3. validate the response - if we.env != "production" { + if we.env == "local" { err = we.validateResponse(requestValidationInput, response) if err != nil { response = logObj.HTTPResponseErrorAction(logutils.ActionValidate, logutils.TypeResponse, &logutils.FieldArgs{"code": response.ResponseCode, "headers": response.Headers, "body": string(response.Body)}, err, http.StatusInternalServerError, true) diff --git a/driver/web/apis_admin.go b/driver/web/apis_admin.go index dec57c272..36201448a 100644 --- a/driver/web/apis_admin.go +++ b/driver/web/apis_admin.go @@ -109,7 +109,7 @@ func (h AdminApisHandler) login(l *logs.Log, r *http.Request, claims *tokenauth. //device requestDevice := requestData.Device - message, loginSession, mfaTypes, err := h.coreAPIs.Auth.Login(ip, string(requestDevice.Type), requestDevice.Os, *requestDevice.DeviceId, string(requestData.AuthType), + message, loginSession, mfaTypes, err := h.coreAPIs.Auth.Login(ip, string(requestDevice.Type), requestDevice.Os, requestDevice.DeviceId, string(requestData.AuthType), requestCreds, requestData.ApiKey, requestData.AppTypeIdentifier, requestData.OrgId, requestParams, &clientVersion, requestProfile, requestPrivacy, requestPreferences, username, true, l) if err != nil { loggingErr, ok := err.(*errors.Error) diff --git a/driver/web/apis_services.go b/driver/web/apis_services.go index f6bbf8408..5442287a5 100644 --- a/driver/web/apis_services.go +++ b/driver/web/apis_services.go @@ -89,7 +89,7 @@ func (h ServicesApisHandler) login(l *logs.Log, r *http.Request, claims *tokenau //device requestDevice := requestData.Device - message, loginSession, mfaTypes, err := h.coreAPIs.Auth.Login(ip, string(requestDevice.Type), requestDevice.Os, *requestDevice.DeviceId, string(requestData.AuthType), + message, loginSession, mfaTypes, err := h.coreAPIs.Auth.Login(ip, string(requestDevice.Type), requestDevice.Os, requestDevice.DeviceId, string(requestData.AuthType), requestCreds, requestData.ApiKey, requestData.AppTypeIdentifier, requestData.OrgId, requestParams, &clientVersion, requestProfile, requestPrivacy, requestPreferences, username, false, l) if err != nil { loggingErr, ok := err.(*errors.Error) diff --git a/driver/web/conversions_user.go b/driver/web/conversions_user.go index c62a4e00a..f976c913d 100644 --- a/driver/web/conversions_user.go +++ b/driver/web/conversions_user.go @@ -400,11 +400,7 @@ func deviceFromDef(item *Def.Device) *model.Device { return nil } - var deviceID string - if item.DeviceId != nil { - deviceID = *item.DeviceId - } - return &model.Device{DeviceID: deviceID, Type: string(item.Type), OS: defString(item.Os)} + return &model.Device{DeviceID: item.DeviceId, Type: string(item.Type), OS: defString(item.Os)} } func deviceToDef(item *model.Device) *Def.Device { @@ -412,7 +408,7 @@ func deviceToDef(item *model.Device) *Def.Device { return nil } - return &Def.Device{Id: &item.ID, DeviceId: &item.DeviceID, Type: Def.DeviceType(item.Type), Os: &item.OS} + return &Def.Device{Id: &item.ID, DeviceId: item.DeviceID, Type: Def.DeviceType(item.Type), Os: &item.OS} } func deviceListToDef(items []model.Device) []Def.Device { diff --git a/driver/web/docs/gen/def.yaml b/driver/web/docs/gen/def.yaml index 06833eafe..e535e8aa8 100644 --- a/driver/web/docs/gen/def.yaml +++ b/driver/web/docs/gen/def.yaml @@ -6890,31 +6890,14 @@ components: - $ref: '#/components/schemas/_shared_req_CredsTwilioPhone' - $ref: '#/components/schemas/_shared_req_CredsOIDC' - $ref: '#/components/schemas/_shared_req_CredsAPIKey' - - required: - - username - - password - type: object - description: Auth login creds for auth_type="username" - properties: - username: - type: string - password: - type: string + - $ref: '#/components/schemas/_shared_req_CredsUsername' params: type: object anyOf: - $ref: '#/components/schemas/_shared_req_ParamsEmail' - $ref: '#/components/schemas/_shared_req_ParamsOIDC' - $ref: '#/components/schemas/_shared_req_ParamsNone' - - type: object - description: Auth login params for auth_type="username" - properties: - confirm_password: - type: string - description: This should match the `creds` password field when sign_up=true. This should be verified on the client side as well to reduce invalid requests. - sign_up: - type: boolean - default: false + - $ref: '#/components/schemas/_shared_req_ParamsUsername' device: $ref: '#/components/schemas/Device' profile: @@ -7120,6 +7103,17 @@ components: description: | Auth login creds for auth_type="oidc" (or variants) - full redirect URI received from OIDC provider + _shared_req_CredsUsername: + required: + - username + - password + type: object + description: Auth login creds for auth_type="username" + properties: + username: + type: string + password: + type: string _shared_req_CredsAPIKey: type: object description: Auth login creds for auth_type="anonymous" @@ -7135,7 +7129,6 @@ components: description: This should match the `creds` password field when sign_up=true. This should be verified on the client side as well to reduce invalid requests. sign_up: type: boolean - default: false _shared_req_ParamsOIDC: type: object description: Auth login params for auth_type="oidc" (or variants) @@ -7144,6 +7137,15 @@ components: type: string pkce_verifier: type: string + _shared_req_ParamsUsername: + type: object + description: Auth login params for auth_type="username" + properties: + confirm_password: + type: string + description: This should match the `creds` password field when sign_up=true. This should be verified on the client side as well to reduce invalid requests. + sign_up: + type: boolean _shared_req_ParamsNone: type: object description: Auth login request params for unlisted auth_types (None) diff --git a/driver/web/docs/gen/gen_types.go b/driver/web/docs/gen/gen_types.go index 1f4935508..e24af0ba0 100644 --- a/driver/web/docs/gen/gen_types.go +++ b/driver/web/docs/gen/gen_types.go @@ -1,12 +1,12 @@ // Package Def provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.13.0 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT. package Def import ( "encoding/json" - "github.com/deepmap/oapi-codegen/pkg/runtime" + "github.com/oapi-codegen/runtime" ) const ( @@ -955,6 +955,12 @@ type SharedReqCredsTwilioPhone struct { Phone string `json:"phone"` } +// SharedReqCredsUsername Auth login creds for auth_type="username" +type SharedReqCredsUsername struct { + Password string `json:"password"` + Username string `json:"username"` +} + // SharedReqLogin defines model for _shared_req_Login. type SharedReqLogin struct { ApiKey string `json:"api_key"` @@ -973,24 +979,11 @@ type SharedReqLogin struct { // SharedReqLoginAuthType defines model for SharedReqLogin.AuthType. type SharedReqLoginAuthType string -// SharedReqLoginCreds4 Auth login creds for auth_type="username" -type SharedReqLoginCreds4 struct { - Password string `json:"password"` - Username string `json:"username"` -} - // SharedReqLogin_Creds defines model for SharedReqLogin.Creds. type SharedReqLogin_Creds struct { union json.RawMessage } -// SharedReqLoginParams3 Auth login params for auth_type="username" -type SharedReqLoginParams3 struct { - // ConfirmPassword This should match the `creds` password field when sign_up=true. This should be verified on the client side as well to reduce invalid requests. - ConfirmPassword *string `json:"confirm_password,omitempty"` - SignUp *bool `json:"sign_up,omitempty"` -} - // SharedReqLogin_Params defines model for SharedReqLogin.Params. type SharedReqLogin_Params struct { union json.RawMessage @@ -1054,6 +1047,13 @@ type SharedReqParamsSetEmailCredential struct { NewPassword string `json:"new_password"` } +// SharedReqParamsUsername Auth login params for auth_type="username" +type SharedReqParamsUsername struct { + // ConfirmPassword This should match the `creds` password field when sign_up=true. This should be verified on the client side as well to reduce invalid requests. + ConfirmPassword *string `json:"confirm_password,omitempty"` + SignUp *bool `json:"sign_up,omitempty"` +} + // SharedReqRefresh defines model for _shared_req_Refresh. type SharedReqRefresh struct { ApiKey string `json:"api_key"` @@ -2283,22 +2283,22 @@ func (t *SharedReqLogin_Creds) MergeSharedReqCredsAPIKey(v SharedReqCredsAPIKey) return err } -// AsSharedReqLoginCreds4 returns the union data inside the SharedReqLogin_Creds as a SharedReqLoginCreds4 -func (t SharedReqLogin_Creds) AsSharedReqLoginCreds4() (SharedReqLoginCreds4, error) { - var body SharedReqLoginCreds4 +// AsSharedReqCredsUsername returns the union data inside the SharedReqLogin_Creds as a SharedReqCredsUsername +func (t SharedReqLogin_Creds) AsSharedReqCredsUsername() (SharedReqCredsUsername, error) { + var body SharedReqCredsUsername err := json.Unmarshal(t.union, &body) return body, err } -// FromSharedReqLoginCreds4 overwrites any union data inside the SharedReqLogin_Creds as the provided SharedReqLoginCreds4 -func (t *SharedReqLogin_Creds) FromSharedReqLoginCreds4(v SharedReqLoginCreds4) error { +// FromSharedReqCredsUsername overwrites any union data inside the SharedReqLogin_Creds as the provided SharedReqCredsUsername +func (t *SharedReqLogin_Creds) FromSharedReqCredsUsername(v SharedReqCredsUsername) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSharedReqLoginCreds4 performs a merge with any union data inside the SharedReqLogin_Creds, using the provided SharedReqLoginCreds4 -func (t *SharedReqLogin_Creds) MergeSharedReqLoginCreds4(v SharedReqLoginCreds4) error { +// MergeSharedReqCredsUsername performs a merge with any union data inside the SharedReqLogin_Creds, using the provided SharedReqCredsUsername +func (t *SharedReqLogin_Creds) MergeSharedReqCredsUsername(v SharedReqCredsUsername) error { b, err := json.Marshal(v) if err != nil { return err @@ -2397,22 +2397,22 @@ func (t *SharedReqLogin_Params) MergeSharedReqParamsNone(v SharedReqParamsNone) return err } -// AsSharedReqLoginParams3 returns the union data inside the SharedReqLogin_Params as a SharedReqLoginParams3 -func (t SharedReqLogin_Params) AsSharedReqLoginParams3() (SharedReqLoginParams3, error) { - var body SharedReqLoginParams3 +// AsSharedReqParamsUsername returns the union data inside the SharedReqLogin_Params as a SharedReqParamsUsername +func (t SharedReqLogin_Params) AsSharedReqParamsUsername() (SharedReqParamsUsername, error) { + var body SharedReqParamsUsername err := json.Unmarshal(t.union, &body) return body, err } -// FromSharedReqLoginParams3 overwrites any union data inside the SharedReqLogin_Params as the provided SharedReqLoginParams3 -func (t *SharedReqLogin_Params) FromSharedReqLoginParams3(v SharedReqLoginParams3) error { +// FromSharedReqParamsUsername overwrites any union data inside the SharedReqLogin_Params as the provided SharedReqParamsUsername +func (t *SharedReqLogin_Params) FromSharedReqParamsUsername(v SharedReqParamsUsername) error { b, err := json.Marshal(v) t.union = b return err } -// MergeSharedReqLoginParams3 performs a merge with any union data inside the SharedReqLogin_Params, using the provided SharedReqLoginParams3 -func (t *SharedReqLogin_Params) MergeSharedReqLoginParams3(v SharedReqLoginParams3) error { +// MergeSharedReqParamsUsername performs a merge with any union data inside the SharedReqLogin_Params, using the provided SharedReqParamsUsername +func (t *SharedReqLogin_Params) MergeSharedReqParamsUsername(v SharedReqParamsUsername) error { b, err := json.Marshal(v) if err != nil { return err diff --git a/driver/web/docs/schemas/apis/shared/requests/ParamsEmail.yaml b/driver/web/docs/schemas/apis/shared/requests/ParamsEmail.yaml index bda67ba45..c80a64ea2 100644 --- a/driver/web/docs/schemas/apis/shared/requests/ParamsEmail.yaml +++ b/driver/web/docs/schemas/apis/shared/requests/ParamsEmail.yaml @@ -5,5 +5,4 @@ properties: type: string description: This should match the `creds` password field when sign_up=true. This should be verified on the client side as well to reduce invalid requests. sign_up: - type: boolean - default: false \ No newline at end of file + type: boolean \ No newline at end of file diff --git a/driver/web/docs/schemas/apis/shared/requests/ParamsUsername.yaml b/driver/web/docs/schemas/apis/shared/requests/ParamsUsername.yaml index 1b2aa801f..9f070b9b4 100644 --- a/driver/web/docs/schemas/apis/shared/requests/ParamsUsername.yaml +++ b/driver/web/docs/schemas/apis/shared/requests/ParamsUsername.yaml @@ -5,5 +5,4 @@ properties: type: string description: This should match the `creds` password field when sign_up=true. This should be verified on the client side as well to reduce invalid requests. sign_up: - type: boolean - default: false \ No newline at end of file + type: boolean \ No newline at end of file diff --git a/driver/web/docs/schemas/index.yaml b/driver/web/docs/schemas/index.yaml index 397c0f1f3..3d15d0165 100644 --- a/driver/web/docs/schemas/index.yaml +++ b/driver/web/docs/schemas/index.yaml @@ -126,12 +126,16 @@ _shared_req_CredsTwilioPhone: $ref: "./apis/shared/requests/CredsTwilioPhone.yaml" _shared_req_CredsOIDC: $ref: "./apis/shared/requests/CredsOIDC.yaml" +_shared_req_CredsUsername: + $ref: "./apis/shared/requests/CredsUsername.yaml" _shared_req_CredsAPIKey: $ref: "./apis/shared/requests/CredsAPIKey.yaml" _shared_req_ParamsEmail: $ref: "./apis/shared/requests/ParamsEmail.yaml" _shared_req_ParamsOIDC: $ref: "./apis/shared/requests/ParamsOIDC.yaml" +_shared_req_ParamsUsername: + $ref: "./apis/shared/requests/ParamsUsername.yaml" _shared_req_ParamsNone: $ref: "./apis/shared/requests/ParamsNone.yaml" _shared_req_ParamsSetEmailCredential: diff --git a/go.mod b/go.mod index 80d481c0d..49d3cf5bc 100644 --- a/go.mod +++ b/go.mod @@ -4,20 +4,20 @@ go 1.20 require ( github.com/coreos/go-oidc v2.2.1+incompatible - github.com/deepmap/oapi-codegen v1.13.0 - github.com/getkin/kin-openapi v0.118.0 + github.com/getkin/kin-openapi v0.120.0 github.com/golang-jwt/jwt v3.2.2+incompatible - github.com/google/uuid v1.3.0 + github.com/google/uuid v1.3.1 github.com/gorilla/mux v1.8.0 github.com/lestrrat-go/jwx v1.2.26 + github.com/oapi-codegen/runtime v1.0.0 github.com/pquerna/otp v1.4.0 - github.com/rokwire/core-auth-library-go/v3 v3.0.1 + github.com/rokwire/core-auth-library-go/v3 v3.1.0 github.com/rokwire/logging-library-go/v2 v2.2.0 github.com/stretchr/testify v1.8.4 github.com/swaggo/http-swagger v1.3.4 - go.mongodb.org/mongo-driver v1.12.0 - golang.org/x/crypto v0.11.0 - golang.org/x/sync v0.3.0 + go.mongodb.org/mongo-driver v1.12.1 + golang.org/x/crypto v0.14.0 + golang.org/x/sync v0.4.0 gopkg.in/go-playground/validator.v9 v9.31.0 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df gopkg.in/yaml.v2 v2.4.0 @@ -26,47 +26,27 @@ require ( require ( github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect - github.com/bytedance/sonic v1.9.2 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/gin-gonic/gin v1.9.1 // indirect - github.com/go-playground/validator/v10 v10.14.1 // indirect github.com/goccy/go-json v0.10.2 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect - github.com/labstack/echo/v4 v4.10.2 // indirect - github.com/labstack/gommon v0.4.0 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect - github.com/lestrrat-go/blackmagic v1.0.1 // indirect + github.com/lestrrat-go/blackmagic v1.0.2 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect github.com/lestrrat-go/option v1.0.1 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.11 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasttemplate v1.2.2 // indirect - golang.org/x/arch v0.4.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect ) require ( github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect github.com/KyleBanks/depth v1.2.1 // indirect - github.com/aws/aws-sdk-go v1.44.298 // indirect + github.com/aws/aws-sdk-go v1.45.24 // indirect github.com/boombuler/barcode v1.0.1 // indirect - github.com/casbin/casbin/v2 v2.71.1 // indirect + github.com/casbin/casbin/v2 v2.77.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonpointer v0.20.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/spec v0.20.9 // indirect github.com/go-openapi/swag v0.22.4 // indirect @@ -78,27 +58,30 @@ require ( github.com/invopop/yaml v0.2.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.17.0 // indirect github.com/leodido/go-urn v1.2.4 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/montanaflynn/stats v0.7.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pquerna/cachecontrol v0.2.0 // indirect - github.com/rs/cors v1.8.3 // indirect + github.com/rs/cors v1.10.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.1 // indirect github.com/swaggo/files v1.0.1 // indirect - github.com/swaggo/swag v1.16.1 // indirect + github.com/swaggo/swag v1.16.2 // indirect + github.com/tidwall/gjson v1.16.0 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.1 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect - golang.org/x/net v0.12.0 // indirect - golang.org/x/oauth2 v0.10.0 // indirect - golang.org/x/sys v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect - golang.org/x/tools v0.11.0 // indirect - google.golang.org/appengine v1.6.7 // indirect + golang.org/x/net v0.16.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/tools v0.14.0 // indirect + google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect diff --git a/go.sum b/go.sum index d28ee16b1..964c10f74 100644 --- a/go.sum +++ b/go.sum @@ -5,20 +5,14 @@ github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6Xge github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= -github.com/aws/aws-sdk-go v1.44.298 h1:5qTxdubgV7PptZJmp/2qDwD2JL187ePL7VOxsSh1i3g= -github.com/aws/aws-sdk-go v1.44.298/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.24 h1:TZx/CizkmCQn8Rtsb11iLYutEQVGK5PK9wAhwouELBo= +github.com/aws/aws-sdk-go v1.45.24/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.9.2 h1:GDaNjuWSGu09guE9Oql0MSTNhNCLlWwO8y/xM5BzcbM= -github.com/bytedance/sonic v1.9.2/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= -github.com/casbin/casbin/v2 v2.71.1 h1:LRHyqM0S1LzM/K59PmfUIN0ZJfLgcOjL4OhOQI/FNXU= -github.com/casbin/casbin/v2 v2.71.1/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/casbin/casbin/v2 v2.77.2 h1:yQinn/w9x8AswiwqwtrXz93VU48R1aYTXdHEx4RI3jM= +github.com/casbin/casbin/v2 v2.77.2/go.mod h1:mzGx0hYW9/ksOSpw3wNjk3NRAroq5VMFYUQ6G43iGPk= github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk= github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -28,20 +22,13 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/deepmap/oapi-codegen v1.13.0 h1:cnFHelhsRQbYvanCUAbRSn/ZpkUb1HPRlQcu8YqSORQ= -github.com/deepmap/oapi-codegen v1.13.0/go.mod h1:Amy7tbubKY9qkZOXqymI3Z6xSbndmu+atMJheLdyg44= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/getkin/kin-openapi v0.118.0 h1:z43njxPmJ7TaPpMSCQb7PN0dEYno4tyBPQcrFdHoLuM= -github.com/getkin/kin-openapi v0.118.0/go.mod h1:l5e9PaFUo9fyLJCPGQeXI2ML8c3P8BHOEV2VaAVf/pc= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg= +github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= +github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= @@ -52,23 +39,19 @@ github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= -github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= -github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -78,12 +61,10 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -92,15 +73,10 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -108,16 +84,13 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M= -github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k= -github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= -github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A= github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= -github.com/lestrrat-go/blackmagic v1.0.1 h1:lS5Zts+5HIC/8og6cGHb0uCcNCa3OUt1ygh3Qz2Fe80= github.com/lestrrat-go/blackmagic v1.0.1/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU= +github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k= +github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU= github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E= github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= @@ -132,27 +105,14 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo= +github.com/oapi-codegen/runtime v1.0.0/go.mod h1:LmCUMQuPB4M/nLXilQXhHw+BLZdDb18B34OO356yJ/A= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -163,21 +123,22 @@ github.com/pquerna/cachecontrol v0.2.0 h1:vBXSNuE5MYP9IJ5kjsdo8uq+w41jSPgvba2DEn github.com/pquerna/cachecontrol v0.2.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg= github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rokwire/core-auth-library-go/v3 v3.0.1 h1:7kZqnXq3lsb8sU+YxXEtHXjmxvFd5X/VpqQKiy/RnqA= -github.com/rokwire/core-auth-library-go/v3 v3.0.1/go.mod h1:VtpVajbA8JPjOzvEFQpxOm4pfok4z/8a2WshErTZd7s= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rokwire/core-auth-library-go/v3 v3.1.0 h1:rsKYetn83BAKZdUYEmMoqSuPkdEsNnEXKBuihApM670= +github.com/rokwire/core-auth-library-go/v3 v3.1.0/go.mod h1:/0SMcZFFaN883sMC0p253CHVRgI+UYOZBEEY9zAo7Ss= github.com/rokwire/logging-library-go/v2 v2.2.0 h1:SKFq+rrl+li1RhEhB7CV+pVcptu/nurX9/DWj/oRaw4= github.com/rokwire/logging-library-go/v2 v2.2.0/go.mod h1:6QSqTlk5nNQcZweqg0sLCCoIwpRpTu3AmOi7EJy38Tg= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= +github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= +github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -185,26 +146,23 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= github.com/swaggo/http-swagger v1.3.4 h1:q7t/XLx0n15H1Q9/tk3Y9L4n210XzJF5WtnDX64a5ww= github.com/swaggo/http-swagger v1.3.4/go.mod h1:9dAh0unqMBAlbp1uE2Uc2mQTxNMU/ha4UbucIg1MFkQ= -github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= -github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04= +github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E= +github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.16.0 h1:SyXa+dsSPpUlcwEDuKuEBJEz5vzTvOea+9rjyYodQFg= +github.com/tidwall/gjson v1.16.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= -github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= -github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= @@ -215,24 +173,20 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7Jul github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE= -go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= -golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +go.mongodb.org/mongo-driver v1.12.1 h1:nLkghSU8fQNaK7oUmDhQFsnrtcoNy7Z6LVFKsEecqgE= +go.mongodb.org/mongo-driver v1.12.1/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -241,40 +195,34 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -282,19 +230,19 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8= -golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= @@ -319,10 +267,8 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/main.go b/main.go index 368cc84c6..c2b531f21 100644 --- a/main.go +++ b/main.go @@ -62,6 +62,8 @@ func main() { logger.SetLevel(*logLevel) } + logger.Infof("Version: %s", Version) + err := utils.SetRandomSeed() if err != nil { logger.Error(err.Error()) @@ -179,7 +181,7 @@ func main() { } authImpl, err := auth.NewAuth(serviceID, host, authPrivKey, authService, storageAdapter, emailer, minTokenExp, maxTokenExp, supportLegacySigs, - twilioAccountSID, twilioToken, twilioServiceSID, profileBBAdapter, smtpHost, smtpPortNum, smtpUser, smtpPassword, smtpFrom, logger) + twilioAccountSID, twilioToken, twilioServiceSID, profileBBAdapter, smtpHost, smtpPortNum, smtpUser, smtpPassword, smtpFrom, logger, Version) if err != nil { logger.Fatalf("Error initializing auth: %v", err) } diff --git a/utils/utils.go b/utils/utils.go index 87d05ee91..9cd6d00af 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -17,7 +17,6 @@ package utils import ( crand "crypto/rand" "crypto/sha256" - "encoding/base64" "encoding/binary" "encoding/json" "fmt" @@ -83,8 +82,12 @@ func GenerateRandomBytes(n int) ([]byte, error) { // GenerateRandomString returns a URL-safe, base64 encoded securely generated random string func GenerateRandomString(s int) (string, error) { - b, err := GenerateRandomBytes(s) - return base64.URLEncoding.EncodeToString(b), err + chars := []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") + b := make([]rune, s) + for i := range b { + b[i] = chars[rand.Intn(len(chars))] + } + return string(b), nil } // GenerateRandomInt returns a random integer between 0 and max