mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: NATS mTLS pubsub implementation (#26902)
This commit is contained in:
@@ -2,7 +2,6 @@ package database
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"slices"
|
||||
"sort"
|
||||
@@ -873,10 +872,6 @@ func (k CryptoKey) ExpiresAt(keyDuration time.Duration) time.Time {
|
||||
return k.StartsAt.Add(keyDuration).UTC()
|
||||
}
|
||||
|
||||
func (k CryptoKey) DecodeString() ([]byte, error) {
|
||||
return hex.DecodeString(k.Secret.String)
|
||||
}
|
||||
|
||||
func (k CryptoKey) CanSign(now time.Time) bool {
|
||||
isAfterStart := !k.StartsAt.IsZero() && !now.Before(k.StartsAt)
|
||||
return isAfterStart && k.CanVerify(now)
|
||||
|
||||
Reference in New Issue
Block a user