mytokenrepohelper

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTokenRevoked

func CheckTokenRevoked(tx *sqlx.Tx, id mtid.MTID, seqno uint64, rot *api.Rotation) (bool, 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 GetMTParentID

func GetMTParentID(myID mtid.MTID) (string, bool, error)

GetMTParentID returns the id of the parent mytoken of the passed mytoken id

func GetMTRootID

func GetMTRootID(id mtid.MTID) (mtid.MTID, bool, error)

GetMTRootID returns the id of the root mytoken of the passed mytoken id

func GetTokenUsagesAT

func GetTokenUsagesAT(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(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(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(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 ParseError

func ParseError(err error) (bool, error)

ParseError parses the passed error for a sql.ErrNoRows

func RevokeMT

func RevokeMT(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(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