forked from openshift/console
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/casper: add a new capser package (openshift#1111)
This commit creates a small casper package with type definitions that will be imported by both the console and the casper proxy.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Example Casper Configuration | ||
|
||
The following JSON snippet shows an example of a valid Casper configuration that can be used by the Console, Console Proxy, or Casper Service: | ||
|
||
```json | ||
{ | ||
"kubectl-client-id": "some_id_1", | ||
"kubectl-client-secret": "some_secret_1", | ||
"oidc-client-id": "some_id_2", | ||
"oidc-client-secret": "some_secret_2", | ||
"url": "https://phillips.example.com:443", | ||
"console": "http://console.example.com", | ||
"clusters": { | ||
"cluster_id_1": { | ||
"name": "cluster 1", | ||
"endpoint": "https://cluster.endpoint1.example.com:443", | ||
"ca": "cluster_ca_certificate" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
This configuration provides all of the data necessary to proxy and authenticate requests from a hosted Console to a cluster. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package casper | ||
|
||
type Config struct { | ||
KubectlClientID string `json:"kubectl-client-id"` | ||
KubectlClientSecret string `json:"kubectl-client-secret"` | ||
OIDCClientID string `json:"oidc-client-id"` | ||
OIDCClientSecret string `json:"oidc-client-secret"` | ||
URL string `json:"url"` | ||
Console string `json:"console"` | ||
Clusters map[string]ClusterConfig `json:"clusters"` | ||
} | ||
|
||
type ClusterConfig struct { | ||
Endpoint string `json:"endpoint"` | ||
Name string `json:"name"` | ||
CA string `json:"ca"` | ||
} |