-
Notifications
You must be signed in to change notification settings - Fork 881
POST license API endpoint #3570
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
Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
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.
frontend ✅
Signed-off-by: Spike Curtis <spike@coder.com>
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.
Most of this looks great! I noted a few minor things and I think we could do something nicer with License.Claims
for the frontend (like defining the known fields). Users of codersdk
might also benefit from exposing known fields.
Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
//go:embed keys/2022-08-12 | ||
var key20220812 []byte | ||
|
||
var keys = map[string]ed25519.PublicKey{"2022-08-12": ed25519.PublicKey(key20220812)} |
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.
Could we make a coderd.API
struct that contains this? Similar to how the AGPL coderd
package is structured.
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.
the public keys are baked in at the package level this way. Isn't this what we want?
It might make it easier to do integration testing if we could inject the keys in as coderd.Options
on creation of the API, so that tests could generate their own keys and then use them, but I worry that sort of machinery would be tempting for end users looking to bypass our licensing. Granted, right now they can just modify the keys/2022-08-12
file, but each layer we bubble this up through makes it that much more obvious how to get away with it.
@@ -0,0 +1,153 @@ | |||
package coderd |
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.
It seems like this test doesn't have to be internal.
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.
it modifies the keys
variable in-place during the tests (patch paradigm). I want to keep that variable unexported, so the tests need to be internal.
Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
PR 1 of 2 for #3279
(next PR will add the
coder license add
CLI command that hits this endpoint