@@ -151,14 +151,23 @@ private static void checkSuccess(int exitCode) {
151151 }
152152
153153 private static String createIdentityKey (String vaultAddr ) throws RestException {
154+ return createIdentityKey (vaultAddr , "1m" , "1m" );
155+ }
156+
157+ private static String createIdentityKey (
158+ String vaultAddr , String rotationPeriod , String verificationTtl ) throws RestException {
154159 String keyName = UUID .randomUUID ().toString ();
155160 int status =
156161 new Rest ()
157162 .header (VAULT_TOKEN_HEADER , VAULT_TOKEN )
158163 .url (oidcKeyUrl (vaultAddr , keyName ))
159164 .body (
160- ("{\" rotation_period\" :\" 1h\" , "
161- + "\" verification_ttl\" : 0, "
165+ ("{\" rotation_period\" :\" "
166+ + rotationPeriod
167+ + "\" , "
168+ + "\" verification_ttl\" : \" "
169+ + verificationTtl
170+ + "\" , "
162171 + "\" allowed_client_ids\" : \" *\" , "
163172 + "\" algorithm\" : \" RS256\" }" )
164173 .getBytes ())
@@ -172,12 +181,17 @@ private static String createIdentityKey(String vaultAddr) throws RestException {
172181 }
173182
174183 private static String createIdentityRole (String vaultAddr , String keyName ) throws RestException {
184+ return createIdentityRole (vaultAddr , keyName , "1h" );
185+ }
186+
187+ private static String createIdentityRole (String vaultAddr , String keyName , String ttl )
188+ throws RestException {
175189 String roleName = UUID .randomUUID ().toString ();
176190 int status =
177191 new Rest ()
178192 .header (VAULT_TOKEN_HEADER , VAULT_TOKEN )
179193 .url (oidcRoleUrl (vaultAddr , roleName ))
180- .body (("{\" key\" :\" " + keyName + "\" ,\" ttl\" : \" 1h \" }" ).getBytes ())
194+ .body (("{\" key\" :\" " + keyName + "\" ,\" ttl\" : \" " + ttl + " \" }" ).getBytes ())
181195 .post ()
182196 .getStatus ();
183197
0 commit comments