mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-28 06:58:54 +00:00
fix: all enums same style (#262)
* fix: all enums same style * fix: rename process to reduce * add some missing enum renaming Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
func TokenByID(db *gorm.DB, table, tokenID string) (*model.Token, error) {
|
||||
token := new(model.Token)
|
||||
query := view.PrepareGetByKey(table, model.TokenSearchKey(token_model.TOKENSEARCHKEY_TOKEN_ID), tokenID)
|
||||
query := view.PrepareGetByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyTokenID), tokenID)
|
||||
err := query(db, token)
|
||||
return token, err
|
||||
}
|
||||
@@ -36,24 +36,24 @@ func PutToken(db *gorm.DB, table string, token *model.Token) error {
|
||||
}
|
||||
|
||||
func DeleteToken(db *gorm.DB, table, tokenID string) error {
|
||||
delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TOKENSEARCHKEY_TOKEN_ID), tokenID)
|
||||
delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyTokenID), tokenID)
|
||||
return delete(db)
|
||||
}
|
||||
|
||||
func DeleteSessionTokens(db *gorm.DB, table, agentID, userID string) error {
|
||||
delete := view.PrepareDeleteByKeys(table,
|
||||
view.Key{Key: model.TokenSearchKey(token_model.TOKENSEARCHKEY_USER_AGENT_ID), Value: agentID},
|
||||
view.Key{Key: model.TokenSearchKey(token_model.TOKENSEARCHKEY_USER_ID), Value: userID},
|
||||
view.Key{Key: model.TokenSearchKey(token_model.TokenSearchKeyUserAgentID), Value: agentID},
|
||||
view.Key{Key: model.TokenSearchKey(token_model.TokenSearchKeyUserID), Value: userID},
|
||||
)
|
||||
return delete(db)
|
||||
}
|
||||
|
||||
func DeleteUserTokens(db *gorm.DB, table, userID string) error {
|
||||
delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TOKENSEARCHKEY_USER_ID), userID)
|
||||
delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyUserID), userID)
|
||||
return delete(db)
|
||||
}
|
||||
|
||||
func DeleteApplicationTokens(db *gorm.DB, table string, appIDs []string) error {
|
||||
delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TOKENSEARCHKEY_APPLICATION_ID), pq.StringArray(appIDs))
|
||||
delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TokenSearchKeyApplicationID), pq.StringArray(appIDs))
|
||||
return delete(db)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user