Skip to content

Commit

Permalink
pkg/casper: add a new capser package (openshift#1111)
Browse files Browse the repository at this point in the history
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
squat authored Nov 9, 2016
1 parent 63bd08c commit 49a559d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
23 changes: 23 additions & 0 deletions doc/example_casper_configuration.md
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.
17 changes: 17 additions & 0 deletions pkg/casper/casper.go
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"`
}

0 comments on commit 49a559d

Please sign in to comment.