mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 00:40:25 +02:00
hpke: add HPKE key to JWKS endpoint (#3762)
* hpke: add HPKE key to JWKS endpoint * fix test, add http caching headers * fix error message * use pointers
This commit is contained in:
parent
52c967b8a5
commit
ba07afc245
11 changed files with 336 additions and 47 deletions
|
@ -30,6 +30,7 @@ import (
|
|||
"github.com/pomerium/pomerium/internal/urlutil"
|
||||
"github.com/pomerium/pomerium/pkg/cryptutil"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/config"
|
||||
"github.com/pomerium/pomerium/pkg/hpke"
|
||||
)
|
||||
|
||||
// DisableHeaderKey is the key used to check whether to disable setting header
|
||||
|
@ -997,6 +998,16 @@ func (o *Options) GetSharedKey() ([]byte, error) {
|
|||
return base64.StdEncoding.DecodeString(sharedKey)
|
||||
}
|
||||
|
||||
// GetHPKEPrivateKey gets the hpke.PrivateKey dervived from the shared key.
|
||||
func (o *Options) GetHPKEPrivateKey() (*hpke.PrivateKey, error) {
|
||||
sharedKey, err := o.GetSharedKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return hpke.DerivePrivateKey(sharedKey), nil
|
||||
}
|
||||
|
||||
// GetGoogleCloudServerlessAuthenticationServiceAccount gets the GoogleCloudServerlessAuthenticationServiceAccount.
|
||||
func (o *Options) GetGoogleCloudServerlessAuthenticationServiceAccount() string {
|
||||
return o.GoogleCloudServerlessAuthenticationServiceAccount
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue