File tree 1 file changed +6
-6
lines changed
enterprise/wsproxy/wsproxysdk
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -220,17 +220,17 @@ type CryptoKey struct {
220
220
StartsAt time.Time `json:"starts_at"`
221
221
}
222
222
223
- func (c CryptoKey ) Active (now time.Time ) bool {
223
+ func (c CryptoKey ) CanSign (now time.Time ) bool {
224
224
now = now .UTC ()
225
225
isAfterStartsAt := ! c .StartsAt .IsZero () && ! now .Before (c .StartsAt )
226
- return isAfterStartsAt && ! c . Invalid (now )
226
+ return isAfterStartsAt && c . CanVerify (now )
227
227
}
228
228
229
- func (c CryptoKey ) Invalid (now time.Time ) bool {
229
+ func (c CryptoKey ) CanVerify (now time.Time ) bool {
230
230
now = now .UTC ()
231
- noSecret := c .Secret = = ""
232
- afterDelete := ! c .DeletesAt .IsZero () && ! now .Before (c .DeletesAt . UTC () )
233
- return noSecret || afterDelete
231
+ hasSecret := c .Secret ! = ""
232
+ beforeDelete := c .DeletesAt .IsZero () || now .Before (c .DeletesAt )
233
+ return hasSecret && beforeDelete
234
234
}
235
235
236
236
type RegisterWorkspaceProxyResponse struct {
You can’t perform that action at this time.
0 commit comments