diff options
author | Alexia Pagkopoulou <a.pagkopoulou@tum.de> | 2019-08-21 13:16:29 +0200 |
---|---|---|
committer | Alexia Pagkopoulou <a.pagkopoulou@tum.de> | 2019-08-21 13:16:29 +0200 |
commit | 517b8bb6108cbdfdb14e117f36e4ec57d04bf838 (patch) | |
tree | 86db1d07917864244b8290fc3c72dfe1a115fcf1 /bin | |
parent | 6d8c83ae2811bf3970aa92338100e870bea5d7ab (diff) | |
download | reclaim-oidc-517b8bb6108cbdfdb14e117f36e4ec57d04bf838.tar.gz reclaim-oidc-517b8bb6108cbdfdb14e117f36e4ec57d04bf838.zip |
added command for changing the jwt secret
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reclaim-oidc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/bin/reclaim-oidc b/bin/reclaim-oidc index b279b31..749c7e9 100755 --- a/bin/reclaim-oidc +++ b/bin/reclaim-oidc | |||
@@ -5,13 +5,14 @@ require 'reclaim_oidc' | |||
5 | class OptParser | 5 | class OptParser |
6 | class ScriptOptions | 6 | class ScriptOptions |
7 | attr_accessor :name, :add, :delete, :list, :description, :redirect_uri, | 7 | attr_accessor :name, :add, :delete, :list, :description, :redirect_uri, |
8 | :verbose | 8 | :verbose, :jwt_secret |
9 | 9 | ||
10 | def initialize | 10 | def initialize |
11 | self.delete = false | 11 | self.delete = false |
12 | self.add = false | 12 | self.add = false |
13 | self.list = false | 13 | self.list = false |
14 | self.verbose = false | 14 | self.verbose = false |
15 | self.jwt_secret = false | ||
15 | end | 16 | end |
16 | 17 | ||
17 | def define_options(parser) | 18 | def define_options(parser) |
@@ -27,6 +28,7 @@ class OptParser | |||
27 | client_redirect_option(parser) | 28 | client_redirect_option(parser) |
28 | client_description_option(parser) | 29 | client_description_option(parser) |
29 | boolean_verbose_option(parser) | 30 | boolean_verbose_option(parser) |
31 | jwt_secret_option(parser) | ||
30 | 32 | ||
31 | parser.separator "" | 33 | parser.separator "" |
32 | parser.separator "Common options:" | 34 | parser.separator "Common options:" |
@@ -87,7 +89,13 @@ class OptParser | |||
87 | self.verbose = v | 89 | self.verbose = v |
88 | end | 90 | end |
89 | end | 91 | end |
90 | end | 92 | |
93 | def jwt_secret_option(parser) | ||
94 | parser.on("-j", "--jwt-secret [JWT-SECRET]", "Set JWT secret") do |v| | ||
95 | self.jwt_secret = v | ||
96 | end | ||
97 | end | ||
98 | end | ||
91 | 99 | ||
92 | # | 100 | # |
93 | # Return a structure describing the options. | 101 | # Return a structure describing the options. |
@@ -152,4 +160,7 @@ if (options.delete) | |||
152 | roidc.delete_client(options.name) | 160 | roidc.delete_client(options.name) |
153 | puts "OK" | 161 | puts "OK" |
154 | end | 162 | end |
155 | 163 | if (options.jwt_secret) | |
164 | roidc.set_jwt_secret(options.jwt_secret) | ||
165 | puts "JWT secret has been changed" | ||
166 | end | ||