-
Notifications
You must be signed in to change notification settings - Fork 883
feat: add endpoint for fetching workspace proxy keys #14789
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
Conversation
Introduce documentation for new API endpoint to fetch workspace proxy signing keys. This addition supports enterprise use cases involving workspace proxies by documenting the models `CryptoKey`, `CryptoKeyFeature`, and `CryptoKeysResponse`.
Improve clarity by changing references from "signing keys" to "crypto keys" in API documentation and comments. This aligns terminology across the codebase and documentation, reducing potential confusion.
func (c CryptoKey) Active(now time.Time) bool { | ||
now = now.UTC() | ||
isAfterStartsAt := !c.StartsAt.IsZero() && !now.Before(c.StartsAt) | ||
return isAfterStartsAt && !c.Invalid(now) | ||
} | ||
|
||
func (c CryptoKey) Invalid(now time.Time) bool { | ||
now = now.UTC() | ||
noSecret := c.Secret == "" | ||
afterDelete := !c.DeletesAt.IsZero() && !now.Before(c.DeletesAt.UTC()) | ||
return noSecret || afterDelete | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this just be a single Valid()
call or something instead? I don't understand why you would want to differentiate these two states since in both cases the key can't be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keys can be used for verification prior to their start time but cannot be used for signing. I'll update the names of the methods to reflect that though
This PR adds an endpoint for fetching signing keys from a workspace proxy. I've intentionally decoupled it from the
register
endpoint since we will need to support fetching keys on demand and it's overkill to have to reregister every time that's necessary. Since we'll support fetching keys on demand we don't need to also be refreshing them every 15s, so decoupling it allows us to set a longer interval (i.e. 10 minutes).