Documentation
¶
Index ¶
- Constants
- type ApiToken
- type ApiTokenCustomClaims
- type ApiTokenRepository
- type ApiTokenRepositoryImpl
- func (impl ApiTokenRepositoryImpl) FindActiveById(id int) (*ApiToken, error)
- func (impl ApiTokenRepositoryImpl) FindAllActive() ([]*ApiToken, error)
- func (impl ApiTokenRepositoryImpl) FindByName(name string) (*ApiToken, error)
- func (impl ApiTokenRepositoryImpl) Save(apiToken *ApiToken) error
- func (impl ApiTokenRepositoryImpl) Update(apiToken *ApiToken) error
- type ApiTokenSecretService
- type ApiTokenSecretServiceImpl
- type ApiTokenService
- type ApiTokenServiceImpl
- func (impl ApiTokenServiceImpl) CreateApiToken(request *openapi.CreateApiTokenRequest, createdBy int32, ...) (*openapi.CreateApiTokenResponse, error)
- func (impl ApiTokenServiceImpl) DeleteApiToken(apiTokenId int, deletedBy int32) (*openapi.ActionResponse, error)
- func (impl ApiTokenServiceImpl) GetAllActiveApiTokens() ([]*openapi.ApiToken, error)
- func (impl ApiTokenServiceImpl) GetAllApiTokensForWebhook(projectName string, environmentName string, appName string, ...) ([]*openapi.ApiToken, error)
- func (impl ApiTokenServiceImpl) UpdateApiToken(apiTokenId int, request *openapi.UpdateApiTokenRequest, updatedBy int32) (*openapi.UpdateApiTokenResponse, error)
Constants ¶
View Source
const API_TOKEN_USER_EMAIL_PREFIX = "API-TOKEN:"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiToken ¶
type ApiToken struct { Id int `sql:"id,pk"` UserId int32 `sql:"user_id, notnull"` Name string `sql:"name, notnull"` Description string `sql:"description, notnull"` ExpireAtInMs int64 `sql:"expire_at_in_ms"` Token string `sql:"token, notnull"` User *repository.UserModel sql.AuditLog // contains filtered or unexported fields }
type ApiTokenCustomClaims ¶
type ApiTokenCustomClaims struct { Email string `json:"email"` jwt.RegisteredClaims }
type ApiTokenRepository ¶
type ApiTokenRepositoryImpl ¶
type ApiTokenRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewApiTokenRepositoryImpl ¶
func NewApiTokenRepositoryImpl(dbConnection *pg.DB) *ApiTokenRepositoryImpl
func (ApiTokenRepositoryImpl) FindActiveById ¶
func (impl ApiTokenRepositoryImpl) FindActiveById(id int) (*ApiToken, error)
func (ApiTokenRepositoryImpl) FindAllActive ¶
func (impl ApiTokenRepositoryImpl) FindAllActive() ([]*ApiToken, error)
func (ApiTokenRepositoryImpl) FindByName ¶
func (impl ApiTokenRepositoryImpl) FindByName(name string) (*ApiToken, error)
func (ApiTokenRepositoryImpl) Save ¶
func (impl ApiTokenRepositoryImpl) Save(apiToken *ApiToken) error
func (ApiTokenRepositoryImpl) Update ¶
func (impl ApiTokenRepositoryImpl) Update(apiToken *ApiToken) error
type ApiTokenSecretService ¶
type ApiTokenSecretServiceImpl ¶
type ApiTokenSecretServiceImpl struct {
// contains filtered or unexported fields
}
func NewApiTokenSecretServiceImpl ¶
func NewApiTokenSecretServiceImpl(logger *zap.SugaredLogger, attributesService attributes.AttributesService, apiTokenSecretStore *apiTokenAuth.ApiTokenSecretStore) (*ApiTokenSecretServiceImpl, error)
func (ApiTokenSecretServiceImpl) GetApiTokenSecretByteArr ¶
func (impl ApiTokenSecretServiceImpl) GetApiTokenSecretByteArr() ([]byte, error)
type ApiTokenService ¶
type ApiTokenService interface { GetAllActiveApiTokens() ([]*openapi.ApiToken, error) CreateApiToken(request *openapi.CreateApiTokenRequest, createdBy int32, managerAuth func(resource, token, object string) bool) (*openapi.CreateApiTokenResponse, error) UpdateApiToken(apiTokenId int, request *openapi.UpdateApiTokenRequest, updatedBy int32) (*openapi.UpdateApiTokenResponse, error) DeleteApiToken(apiTokenId int, deletedBy int32) (*openapi.ActionResponse, error) GetAllApiTokensForWebhook(projectName string, environmentName string, appName string, auth func(token string, projectObject string, envObject string) bool) ([]*openapi.ApiToken, error) }
type ApiTokenServiceImpl ¶
type ApiTokenServiceImpl struct {
// contains filtered or unexported fields
}
func NewApiTokenServiceImpl ¶
func NewApiTokenServiceImpl(logger *zap.SugaredLogger, apiTokenSecretService ApiTokenSecretService, userService user.UserService, userAuditService user.UserAuditService, apiTokenRepository ApiTokenRepository) *ApiTokenServiceImpl
func (ApiTokenServiceImpl) CreateApiToken ¶
func (impl ApiTokenServiceImpl) CreateApiToken(request *openapi.CreateApiTokenRequest, createdBy int32, managerAuth func(resource, token string, object string) bool) (*openapi.CreateApiTokenResponse, error)
func (ApiTokenServiceImpl) DeleteApiToken ¶
func (impl ApiTokenServiceImpl) DeleteApiToken(apiTokenId int, deletedBy int32) (*openapi.ActionResponse, error)
func (ApiTokenServiceImpl) GetAllActiveApiTokens ¶
func (impl ApiTokenServiceImpl) GetAllActiveApiTokens() ([]*openapi.ApiToken, error)
func (ApiTokenServiceImpl) GetAllApiTokensForWebhook ¶ added in v0.6.9
func (ApiTokenServiceImpl) UpdateApiToken ¶
func (impl ApiTokenServiceImpl) UpdateApiToken(apiTokenId int, request *openapi.UpdateApiTokenRequest, updatedBy int32) (*openapi.UpdateApiTokenResponse, error)
Click to show internal directories.
Click to hide internal directories.