/** * Disconnects from ZooKeeper unless told not to. */ @Override public void destroy() { if (shouldDisconnect && client != null) { client.close(); } super.destroy(); }
/** * Initialize the SignerSecretProvider. It initializes the current secret * and starts the scheduler for the rollover to run at an interval of * tokenValidity. * @param config filter configuration * @param tokenValidity The amount of time a token is valid for * @throws Exception */ @Override public void init(Properties config, long tokenValidity) throws Exception { initSecrets(generateNewSecret(), null); startScheduler(tokenValidity, tokenValidity); }
@Override public void run() { rollSecret(); } }, initialDelay, period, TimeUnit.MILLISECONDS);
@Override protected synchronized void rollSecret() { super.rollSecret(); // Try to push the information to ZooKeeper with a potential next secret. nextRolloverDate += tokenValidity; byte[][] secrets = super.getAllSecrets(); pushToZK(generateRandomSecret(), secrets[0], secrets[1]); // Pull info from ZooKeeper to get the decided next secret // passing false tells it that we don't care about most of the data pullFromZK(false); }
/** * Rolls the secret. It is called automatically at the rollover interval. */ protected synchronized void rollSecret() { if (!isDestroyed) { LOG.debug("rolling secret"); byte[] newSecret = generateNewSecret(); secrets = new byte[][]{newSecret, secrets[0]}; } }
bb.get(previousSecret); super.initSecrets(currentSecret, previousSecret); nextRolloverDate = bb.getLong();
super.startScheduler(initialDelay, tokenValidity);
@Override protected synchronized void rollSecret() { super.rollSecret(); // Try to push the information to ZooKeeper with a potential next secret. nextRolloverDate += tokenValidity; byte[][] secrets = super.getAllSecrets(); pushToZK(generateRandomSecret(), secrets[0], secrets[1]); // Pull info from ZooKeeper to get the decided next secret // passing false tells it that we don't care about most of the data pullFromZK(false); }
/** * Rolls the secret. It is called automatically at the rollover interval. */ protected synchronized void rollSecret() { if (!isDestroyed) { LOG.debug("rolling secret"); byte[] newSecret = generateNewSecret(); secrets = new byte[][]{newSecret, secrets[0]}; } }
bb.get(previousSecret); super.initSecrets(currentSecret, previousSecret); nextRolloverDate = bb.getLong();
super.startScheduler(initialDelay, tokenValidity);
/** * Initialize the SignerSecretProvider. It initializes the current secret * and starts the scheduler for the rollover to run at an interval of * tokenValidity. * @param config configuration properties * @param servletContext servlet context * @param tokenValidity The amount of time a token is valid for * @throws Exception thrown if an error occurred */ @Override public void init(Properties config, ServletContext servletContext, long tokenValidity) throws Exception { initSecrets(generateNewSecret(), null); startScheduler(tokenValidity, tokenValidity); }
@Override protected synchronized void rollSecret() { super.rollSecret(); // Try to push the information to ZooKeeper with a potential next secret. nextRolloverDate += tokenValidity; byte[][] secrets = super.getAllSecrets(); pushToZK(generateRandomSecret(), secrets[0], secrets[1]); // Pull info from ZooKeeper to get the decided next secret // passing false tells it that we don't care about most of the data pullFromZK(false); }
/** * Rolls the secret. It is called automatically at the rollover interval. */ protected synchronized void rollSecret() { if (!isDestroyed) { LOG.debug("rolling secret"); byte[] newSecret = generateNewSecret(); secrets = new byte[][]{newSecret, secrets[0]}; } }
@Override public void run() { rollSecret(); } }, initialDelay, period, TimeUnit.MILLISECONDS);
/** * Disconnects from ZooKeeper unless told not to. */ @Override public void destroy() { if (shouldDisconnect && client != null) { client.close(); } super.destroy(); }
bb.get(previousSecret); super.initSecrets(currentSecret, previousSecret); nextRolloverDate = bb.getLong();
super.startScheduler(initialDelay, tokenValidity);
/** * Initialize the SignerSecretProvider. It initializes the current secret * and starts the scheduler for the rollover to run at an interval of * tokenValidity. * @param config configuration properties * @param servletContext servlet context * @param tokenValidity The amount of time a token is valid for * @throws Exception */ @Override public void init(Properties config, ServletContext servletContext, long tokenValidity) throws Exception { initSecrets(generateNewSecret(), null); startScheduler(tokenValidity, tokenValidity); }
@Override protected synchronized void rollSecret() { super.rollSecret(); // Try to push the information to ZooKeeper with a potential next secret. nextRolloverDate += tokenValidity; byte[][] secrets = super.getAllSecrets(); pushToZK(generateRandomSecret(), secrets[0], secrets[1]); // Pull info from ZooKeeper to get the decided next secret // passing false tells it that we don't care about most of the data pullFromZK(false); }