Skip to content
Snippets Groups Projects
Commit bd2234cd authored by Rui Yang's avatar Rui Yang
Browse files

Add constructor for static key strategy


Co-authored-by: default avatarJosh Winters <jwinter@pivotal.io>
Signed-off-by: default avatarRui Yang <ruiya@vmware.com>
parent 9781e56b
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ package server
import (
"context"
"crypto/rsa"
"encoding/json"
"errors"
"fmt"
......@@ -172,6 +173,13 @@ func NewServer(ctx context.Context, c Config) (*Server, error) {
))
}
// NewServerWithKey constructs a server from the provided config and a static signing key.
func NewServerWithKey(ctx context.Context, c Config, privateKey *rsa.PrivateKey) (*Server, error) {
return newServer(ctx, c, staticRotationStrategy(
privateKey,
))
}
func newServer(ctx context.Context, c Config, rotationStrategy rotationStrategy) (*Server, error) {
issuerURL, err := url.Parse(c.Issuer)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment