utils

package
v0.0.0-...-57ba8d9 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnrootImageFormat

func EnrootImageFormat(dockerImage string) (enrootImage string, err error)

EnrootImageFormat transforms the input dockerImage into a string suitable for enroot.

See: https://docs.cscs.ch/software/container-engine/run/#pulling-images-manually

func IsNotExpired

func IsNotExpired(expiresAt time.Time, margin time.Duration, required bool) bool

IsNotExpired returns true if expiresAt is still in the future, with a given margin. When expiresAt is zero, returns !required.

func VerifyExpiresAtClaim

func VerifyExpiresAtClaim(claims jwt.RegisteredClaims, margin time.Duration, required bool) (bool, error)

VerifyExpiresAtClaim returns true is the expiry (claims.GetExpirationTime()) is still in the future, with a given margin. When the expiry is omitted, returns !required.

func VerifyJWTExpiresAt

func VerifyJWTExpiresAt(token string, margin time.Duration, required bool) (bool, error)

VerifyJWTExpiresAt returns true is the expiry (from the "exp" claim) is still in the future, with a given margin. When the expiry is omitted, returns !required.

Types

This section is empty.

Jump to

Keyboard shortcuts

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