From c709e2173971bfb84bd3d924faf95a2401bcc440 Mon Sep 17 00:00:00 2001 From: Jakub Kabza Date: Fri, 30 Aug 2019 08:59:09 +0200 Subject: [PATCH] samples + message fix --- config/samples/hydra_v1alpha1_oauth2client.yaml | 15 ++++++++++++--- main.go | 8 ++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/config/samples/hydra_v1alpha1_oauth2client.yaml b/config/samples/hydra_v1alpha1_oauth2client.yaml index a20eaee..a644bf2 100644 --- a/config/samples/hydra_v1alpha1_oauth2client.yaml +++ b/config/samples/hydra_v1alpha1_oauth2client.yaml @@ -1,7 +1,16 @@ apiVersion: hydra.ory.sh/v1alpha1 kind: OAuth2Client metadata: - name: oauth2client-sample + name: my-oauth2-client + namespace: default spec: - # Add fields here - foo: bar + grantTypes: + - client_credentials + - implicit + - authorization_code + - refresh_token + responseTypes: + - id_token + - code + - token + scope: "read write" \ No newline at end of file diff --git a/main.go b/main.go index a137404..1c76d8b 100644 --- a/main.go +++ b/main.go @@ -49,13 +49,13 @@ func init() { func main() { var metricsAddr string var hydraURL string - var port int + var hydraPort int var endpoint string var enableLeaderElection bool flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.") flag.StringVar(&hydraURL, "hydra-url", "", "The address of ORY Hydra") - flag.IntVar(&port, "port", 4445, "Port ORY Hydra is listening on") + flag.IntVar(&hydraPort, "hydra-port", 4445, "Port ORY Hydra is listening on") flag.StringVar(&endpoint, "endpoint", "/clients", "ORY Hydra's client endpoint") flag.BoolVar(&enableLeaderElection, "enable-leader-election", false, "Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.") @@ -74,11 +74,11 @@ func main() { } if hydraURL == "" { - setupLog.Error(fmt.Errorf("hydra service address can't be empty"), "unable to create controller", "controller", "OAuth2Client") + setupLog.Error(fmt.Errorf("hydra URL can't be empty"), "unable to create controller", "controller", "OAuth2Client") os.Exit(1) } - u, err := url.Parse(fmt.Sprintf("%s:%d", hydraURL, port)) + u, err := url.Parse(fmt.Sprintf("%s:%d", hydraURL, hydraPort)) if err != nil { setupLog.Error(err, "unable to parse ORY Hydra's URL", "controller", "OAuth2Client") os.Exit(1)