mytokenrepohelper

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 RevokeMT

func RevokeMT(rlog log.Ext1FieldLogger, tx *sqlx.Tx, id mtid.MTID, 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