mytokenrepohelper

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMytokensAreForSameUser added in v0.6.0

func CheckMytokensAreForSameUser(rlog log.Ext1FieldLogger, tx *sqlx.Tx, a, b interface{}) (
	same bool, err error,
)

CheckMytokensAreForSameUser checks if two mytoken ids belong to the same user

func CheckTokenRevoked

func CheckTokenRevoked(rlog log.Ext1FieldLogger, tx *sqlx.Tx, id mtid.MTID, seqno uint64, rot *api.Rotation) (
	revoked bool, err error,
)

CheckTokenRevoked checks if a Mytoken has been revoked. If it is a rotating mytoken and auto_revoke is enabled for this token, it might get triggered.

func GetMTName added in v0.4.0

func GetMTName(rlog log.Ext1FieldLogger, tx *sqlx.Tx, id mtid.MTID) (name db.NullString, err error)

GetMTName returns the name of the mytoken

func GetTokenUsagesAT

func GetTokenUsagesAT(rlog log.Ext1FieldLogger, tx *sqlx.Tx, myID mtid.MTID, restrictionHash string) (
	usages *int64, err error,
)

GetTokenUsagesAT returns how often a Mytoken was used with a specific restriction to obtain an access token

func GetTokenUsagesOther

func GetTokenUsagesOther(rlog log.Ext1FieldLogger, tx *sqlx.Tx, myID mtid.MTID, restrictionHash string) (
	usages *int64, err error,
)

GetTokenUsagesOther returns how often a Mytoken was used with a specific restriction to do something else than obtaining an access token

func IncreaseTokenUsageAT

func IncreaseTokenUsageAT(rlog log.Ext1FieldLogger, tx *sqlx.Tx, myID mtid.MTID, jsonRestriction []byte) error

IncreaseTokenUsageAT increases the usage count for obtaining ATs with a Mytoken and the given restriction

func IncreaseTokenUsageOther

func IncreaseTokenUsageOther(rlog log.Ext1FieldLogger, tx *sqlx.Tx, myID mtid.MTID, jsonRestriction []byte) error

IncreaseTokenUsageOther increases the usage count for other usages with a Mytoken and the given restriction

func RevocationIDHasParent added in v0.5.0

func RevocationIDHasParent(rlog log.Ext1FieldLogger, tx *sqlx.Tx, revocationID string, parent mtid.MTID) (
	isParent bool, err error,
)

RevocationIDHasParent checks if the token for a revocation id is a child of the (potential) parent mytoken

func RevokeMT

func RevokeMT(rlog log.Ext1FieldLogger, tx *sqlx.Tx, id interface{}, recursive bool) error

RevokeMT revokes the passed mytoken and depending on the recursive parameter also its children

func UpdateSeqNo added in v0.3.0

func UpdateSeqNo(rlog log.Ext1FieldLogger, tx *sqlx.Tx, id mtid.MTID, seqno uint64) error

UpdateSeqNo updates the sequence number of a mytoken, i.e. it rotates the mytoken. Don't forget to update the encryption key

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL