-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
Split sagoodkey.NewKeyPolicy from goodkey.NewKeyPolicy #6651
Split sagoodkey.NewKeyPolicy from goodkey.NewKeyPolicy #6651
Conversation
... so that goodkey no longer depends on google.golang.org/grpc and github.com/letsencrypt/boulder/sa/proto , making it cheaper to use from external Go code. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2beef96
to
0e8e289
Compare
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.
Hey, this is cool, thank you! This change seems like the cleanest way I can think of to achieve this separation. LGTM with one minor nit, and we require two approvals on all changes here so I'm requesting review from the rest of the team as well.
goodkey/good_key.go
Outdated
@@ -146,10 +146,10 @@ func (policy *KeyPolicy) GoodKey(ctx context.Context, key crypto.PublicKey) erro | |||
if err != nil { | |||
return badKey("%w", err) | |||
} | |||
exists, err := policy.dbCheck(ctx, &sapb.KeyBlockedRequest{KeyHash: digest[:]}) | |||
exists, err := policy.dbCheck(ctx, digest[:]) |
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.
Now that BlockedKeyCheckFunc is much more generic, I'd consider renaming policy.dbCheck
to policy.blockedCheck
or something like that.
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.
Updated, thanks!
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Thanks! |
This removes quite a bit of dependent code (295 kB on macOS). It also adds a new github.com/go-jose/go-jose.v2 , but we'll get rid of that again after letsencrypt/boulder#6581 lands. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This removes quite a bit of dependent code (295 kB on macOS). It also adds a new github.com/go-jose/go-jose.v2 , but we'll get rid of that again after letsencrypt/boulder#6581 lands. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Update letsencrypt/boulder after letsencrypt/boulder#6651
This picks up letsencrypt/boulder#6651 which makes it easier to untangle our dependency on grpc and protobuf.
... so that
goodkey
no longer depends ongoogle.golang.org/grpc
andgithub.com/letsencrypt/boulder/sa/proto
, making it cheaper to use from external Go code.For better or worse, the
goodkey
package is used by external callers like https://github.com/sigstore/sigstore/blob/6ba2c727c278dd46958e3446c5f8039d00a27308/pkg/cryptoutils/publickey.go#L148 ; those callers have no use for the GRPC definitions.This PR allows such callers to no longer include the
github.com/letsencrypt/boulder/core/proto
andgithub.com/letsencrypt/boulder/sa/proto
subpackages, allowing to shave 295 kB from the binary size.Existing tests were used unchanged in the new
sagoodkey
package, and adapted directly ingoodkey
.