mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-28 18:06:34 +02:00
Fetch the HPKE public key only when configured to use the hosted authenticate service. Determine whether we are using the hosted authenticate service by comparing the resolved authenticate domain with a hard-coded list of hosted authenticate domains. Extract this list of hosted authenticate domains to the internal/urlutil package in order to keep a single source of truth for this data.
18 lines
333 B
Go
18 lines
333 B
Go
package hpke
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type stubFetcher struct {
|
|
key *PublicKey
|
|
}
|
|
|
|
func (f stubFetcher) FetchPublicKey(_ context.Context) (*PublicKey, error) {
|
|
return f.key, nil
|
|
}
|
|
|
|
// NewStubKeyFetcher returns a new KeyFetcher which returns a fixed key.
|
|
func NewStubKeyFetcher(key *PublicKey) KeyFetcher {
|
|
return stubFetcher{key}
|
|
}
|