Inline
This commit is contained in:
@@ -219,7 +219,7 @@ func (s *OAuth2ServiceImpl) SaveExternalService(ctx context.Context, registratio
|
|||||||
return nil, errGenCred
|
return nil, errGenCred
|
||||||
}
|
}
|
||||||
|
|
||||||
s.logger.Debug("Handle service account save")
|
s.logger.Debug("Save service account")
|
||||||
saID, errSaveServiceAccount := s.saveServiceAccount(ctx, client.Name, client.ServiceAccountID, registration.Permissions)
|
saID, errSaveServiceAccount := s.saveServiceAccount(ctx, client.Name, client.ServiceAccountID, registration.Permissions)
|
||||||
if errSaveServiceAccount != nil {
|
if errSaveServiceAccount != nil {
|
||||||
return nil, errSaveServiceAccount
|
return nil, errSaveServiceAccount
|
||||||
@@ -260,8 +260,7 @@ func (s *OAuth2ServiceImpl) SaveExternalService(ctx context.Context, registratio
|
|||||||
// randString generates a a cryptographically secure random string of n bytes
|
// randString generates a a cryptographically secure random string of n bytes
|
||||||
func (s *OAuth2ServiceImpl) randString(n int) (string, error) {
|
func (s *OAuth2ServiceImpl) randString(n int) (string, error) {
|
||||||
res := make([]byte, n)
|
res := make([]byte, n)
|
||||||
_, err := rand.Read(res)
|
if _, err := rand.Read(res); err != nil {
|
||||||
if err != nil {
|
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return base64.RawURLEncoding.EncodeToString(res), nil
|
return base64.RawURLEncoding.EncodeToString(res), nil
|
||||||
|
|||||||
Reference in New Issue
Block a user