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

Change current time when running under go test #29

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

mizzy
Copy link
Member

@mizzy mizzy commented Aug 15, 2024

テスト実行時には、有効期限切れの証明書でもVerifyが通るよう、CurrentTimeにNotAfterの1日前の日時をセットします。テストではない通常実行の場合は、CurrentTimeに現在日時をセットします。

signer.NotAfterそのままでもVerifyは通るのですが、境界値だと通るかどうか不安になってしまうのと、意図をわかりやすくするために、あえてNotAfterの一日前に設定しています。

In order to pass signer.Verify() even if the certificate expiration
date is INVALID.
@mizzy mizzy self-assigned this Aug 15, 2024
@mizzy mizzy marked this pull request as ready for review August 15, 2024 00:42
@mizzy mizzy requested a review from azonti August 15, 2024 00:42
Copy link
Contributor

@azonti azonti left a comment

Choose a reason for hiding this comment

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

LGTMです!ありがとうございます

@azonti azonti merged commit 7f95b3f into master Aug 15, 2024
1 check passed
@mizzy mizzy deleted the feature/change-current-time branch August 15, 2024 03:39
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.

2 participants