Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validFrom and validUntil aliases for issuanceDate and expirationDate #97

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

gerardsn
Copy link
Member

Needed for StatusList2021. These are already in the v1 vc context, and issuanceDate/expirationDate have been removed in v2. (v1 also mentions possible future addition of 'issued', but this does not exist in the v2 model so not added for now)

vc/vc.go Outdated
Comment on lines 142 to 154
// IssuanceDate is a rfc3339 formatted datetime. Has alias ValidFrom
IssuanceDate *time.Time `json:"issuanceDate,omitempty"`
// ValidFrom is a rfc3339 formatted datetime. It is optional, and is mutually exclusive with IssuanceDate (not enforced).
// It's a forwards compatible alternative for IssuanceDate.
// The jwt-vc 'nbf' field will unmarshal to IssuanceDate, which may not match with the JSON-LD definition of certain VCs.
ValidFrom *time.Time `json:"validFrom,omitempty"`
// ExpirationDate is a rfc3339 formatted datetime. Has alias ValidUntil. It is optional
ExpirationDate *time.Time `json:"expirationDate,omitempty"`
// ValidFrom is a rfc3339 formatted datetime. It is optional, and is mutually exclusive with ExpirationDate (not enforced).
// It's a forwards compatible alternative for ExpirationDate.
// The jwt-vc 'exp' field will unmarshal to ExpirationDate, which may not match with the JSON-LD definition of certain VCs.
ValidUntil *time.Time `json:"validUntil,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add some info on which spec version desires which field

@gerardsn gerardsn force-pushed the feature/add-validFrom-validUntil branch from feec50c to b4e44e3 Compare December 1, 2023 09:00
@gerardsn gerardsn merged commit c2e3cb8 into master Dec 1, 2023
1 check passed
@gerardsn gerardsn deleted the feature/add-validFrom-validUntil branch December 1, 2023 09:01
gerardsn added a commit that referenced this pull request Mar 28, 2024
gerardsn added a commit that referenced this pull request Mar 28, 2024
* Revert "add clock skew to ValidAt (#100)"

This reverts commit 6d13fd4.

* Revert "Add validFrom and validUntil aliases for issuanceDate and expirationDate (#97)"

This reverts commit c2e3cb8.

* keep VC.ValidAt()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants