public void setup() { Auth.setupTable(PERMISSIONS_CF, PERMISSIONS_CF_SCHEMA); try { String query = String.format("SELECT permissions FROM %s.%s WHERE username = ? AND resource = ?", Auth.AUTH_KS, PERMISSIONS_CF); authorizeStatement = (SelectStatement) QueryProcessor.parseStatement(query).prepare().statement; } catch (RequestValidationException e) { throw new AssertionError(e); // not supposed to happen } }
public void setup() { Auth.setupTable(CREDENTIALS_CF, CREDENTIALS_CF_SCHEMA); // the delay is here to give the node some time to see its peers - to reduce // "skipped default user setup: some nodes are were not ready" log spam. // It's the only reason for the delay. ScheduledExecutors.nonPeriodicTasks.schedule(new Runnable() { public void run() { setupDefaultUser(); } }, Auth.SUPERUSER_SETUP_DELAY, TimeUnit.MILLISECONDS); try { String query = String.format("SELECT %s FROM %s.%s WHERE username = ?", SALTED_HASH, Auth.AUTH_KS, CREDENTIALS_CF); authenticateStatement = (SelectStatement) QueryProcessor.parseStatement(query).prepare().statement; } catch (RequestValidationException e) { throw new AssertionError(e); // not supposed to happen } }
setupTable(USERS_CF, USERS_CF_SCHEMA);