scitokens / scitokens-go

Other
3 stars 1 forks source link

Enforce audience claim #5

Closed retzkek closed 3 years ago

retzkek commented 3 years ago

This add a WithAudience validator and a convenience RequireAudience method on Enforcer. If specified, the enforcer will check that the token has the audience string specified, or one of the special wildcard audiences, by default "ANY" and "https://wlcg.cern.ch/jwt/v1/any". If not specified, audience will not be checked at all.

This also adds Version() string to the SciToken interface, and methods to retrieve the version from the ver or wlcg.ver claim. In the latter case the version will be returned as wlcg:$ver.

Fixes #4