mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-18 22:14:22 +00:00
Rename project
This commit is contained in:
+10
-10
@@ -5,16 +5,16 @@ SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package api
|
||||
|
||||
// Config contains knobs to setup an instance of placeholder-name.
|
||||
// Config contains knobs to setup an instance of pinniped.
|
||||
type Config struct {
|
||||
WebhookConfig WebhookConfigSpec `json:"webhook"`
|
||||
DiscoveryConfig DiscoveryConfigSpec `json:"discovery"`
|
||||
WebhookConfig WebhookConfigSpec `json:"webhook"`
|
||||
DiscoveryInfo DiscoveryInfoSpec `json:"discovery"`
|
||||
}
|
||||
|
||||
// WebhookConfig contains configuration knobs specific to placeholder-name's use
|
||||
// WebhookConfig contains configuration knobs specific to Pinniped's use
|
||||
// of a webhook for token validation.
|
||||
type WebhookConfigSpec struct {
|
||||
// URL contains the URL of the webhook that placeholder-name will use
|
||||
// URL contains the URL of the webhook that pinniped will use
|
||||
// to validate external credentials.
|
||||
URL string `json:"url"`
|
||||
|
||||
@@ -23,11 +23,11 @@ type WebhookConfigSpec struct {
|
||||
CABundle []byte `json:"caBundle"`
|
||||
}
|
||||
|
||||
// DiscoveryConfigSpec contains configuration knobs specific to
|
||||
// placeholder-name's publishing of discovery information. These values can be
|
||||
// viewed as overrides, i.e., if these are set, then placeholder-name will
|
||||
// DiscoveryInfoSpec contains configuration knobs specific to
|
||||
// pinniped's publishing of discovery information. These values can be
|
||||
// viewed as overrides, i.e., if these are set, then pinniped will
|
||||
// publish these values in its discovery document instead of the ones it finds.
|
||||
type DiscoveryConfigSpec struct {
|
||||
// URL contains the URL at which placeholder-name can be contacted.
|
||||
type DiscoveryInfoSpec struct {
|
||||
// URL contains the URL at which pinniped can be contacted.
|
||||
URL *string `json:"url,omitempty"`
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/suzerain-io/placeholder-name/pkg/config/api"
|
||||
"github.com/suzerain-io/pinniped/pkg/config/api"
|
||||
)
|
||||
|
||||
// FromPath loads an api.Config from a provided local file path.
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/suzerain-io/placeholder-name/pkg/config/api"
|
||||
"github.com/suzerain-io/pinniped/pkg/config/api"
|
||||
)
|
||||
|
||||
func TestFromPath(t *testing.T) {
|
||||
@@ -23,7 +23,7 @@ func TestFromPath(t *testing.T) {
|
||||
name: "Happy",
|
||||
path: "testdata/happy.yaml",
|
||||
wantConfig: &api.Config{
|
||||
DiscoveryConfig: api.DiscoveryConfigSpec{
|
||||
DiscoveryInfo: api.DiscoveryInfoSpec{
|
||||
URL: stringPtr("https://some.discovery/url"),
|
||||
},
|
||||
WebhookConfig: api.WebhookConfigSpec{
|
||||
@@ -36,7 +36,7 @@ func TestFromPath(t *testing.T) {
|
||||
name: "NoDiscovery",
|
||||
path: "testdata/no-discovery.yaml",
|
||||
wantConfig: &api.Config{
|
||||
DiscoveryConfig: api.DiscoveryConfigSpec{
|
||||
DiscoveryInfo: api.DiscoveryInfoSpec{
|
||||
URL: nil,
|
||||
},
|
||||
WebhookConfig: api.WebhookConfigSpec{
|
||||
|
||||
@@ -18,13 +18,13 @@ import (
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
||||
|
||||
"github.com/suzerain-io/placeholder-name/pkg/config/api"
|
||||
"github.com/suzerain-io/pinniped/pkg/config/api"
|
||||
)
|
||||
|
||||
// NewWebhook creates a webhook from the provided API server url and caBundle
|
||||
// used to validate TLS connections.
|
||||
func NewWebhook(spec api.WebhookConfigSpec) (*webhook.WebhookTokenAuthenticator, error) {
|
||||
kubeconfig, err := ioutil.TempFile("", "placeholder-name-webhook-kubeconfig-*")
|
||||
kubeconfig, err := ioutil.TempFile("", "pinniped-webhook-kubeconfig-*")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create temp file: %w", err)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
func TestAnonymousKubeconfig(t *testing.T) {
|
||||
expect := require.New(t)
|
||||
|
||||
f, err := ioutil.TempFile("", "placeholder-name-anonymous-kubeconfig-test-*")
|
||||
f, err := ioutil.TempFile("", "pinniped-anonymous-kubeconfig-test-*")
|
||||
expect.NoError(err)
|
||||
defer os.Remove(f.Name())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user