private SelectStatement prepareLegacySelectUserStatement() { return (SelectStatement) prepare("SELECT * FROM %s.%s WHERE name = ?", SchemaConstants.AUTH_KEYSPACE_NAME, LEGACY_USERS_TABLE); }
public void setup() { loadRoleStatement = (SelectStatement) prepare("SELECT * from %s.%s WHERE role = ?", SchemaConstants.AUTH_KEYSPACE_NAME, AuthKeyspace.ROLES); // If the old users table exists, we may need to migrate the legacy authn // data to the new table. We also need to prepare a statement to read from // it, so we can continue to use the old tables while the cluster is upgraded. // Otherwise, we may need to create a default superuser role to enable others // to be added. if (Schema.instance.getCFMetaData(SchemaConstants.AUTH_KEYSPACE_NAME, "users") != null) { legacySelectUserStatement = prepareLegacySelectUserStatement(); scheduleSetupTask(() -> { convertLegacyData(); return null; }); } else { scheduleSetupTask(() -> { setupDefaultRole(); return null; }); } }
public void setup() { loadRoleStatement = (SelectStatement) prepare("SELECT * from %s.%s WHERE role = ?", SchemaConstants.AUTH_KEYSPACE_NAME, AuthKeyspace.ROLES); // If the old users table exists, we may need to migrate the legacy authn // data to the new table. We also need to prepare a statement to read from // it, so we can continue to use the old tables while the cluster is upgraded. // Otherwise, we may need to create a default superuser role to enable others // to be added. if (Schema.instance.getCFMetaData(SchemaConstants.AUTH_KEYSPACE_NAME, "users") != null) { legacySelectUserStatement = prepareLegacySelectUserStatement(); scheduleSetupTask(() -> { convertLegacyData(); return null; }); } else { scheduleSetupTask(() -> { setupDefaultRole(); return null; }); } }
private SelectStatement prepareLegacySelectUserStatement() { return (SelectStatement) prepare("SELECT * FROM %s.%s WHERE name = ?", SchemaConstants.AUTH_KEYSPACE_NAME, LEGACY_USERS_TABLE); }
public void setup() { loadRoleStatement = (SelectStatement) prepare("SELECT * from %s.%s WHERE role = ?", SchemaConstants.AUTH_KEYSPACE_NAME, AuthKeyspace.ROLES); // If the old users table exists, we may need to migrate the legacy authn // data to the new table. We also need to prepare a statement to read from // it, so we can continue to use the old tables while the cluster is upgraded. // Otherwise, we may need to create a default superuser role to enable others // to be added. if (Schema.instance.getCFMetaData(SchemaConstants.AUTH_KEYSPACE_NAME, "users") != null) { legacySelectUserStatement = prepareLegacySelectUserStatement(); scheduleSetupTask(() -> { convertLegacyData(); return null; }); } else { scheduleSetupTask(() -> { setupDefaultRole(); return null; }); } }
private SelectStatement prepareLegacySelectUserStatement() { return (SelectStatement) prepare("SELECT * FROM %s.%s WHERE name = ?", SchemaConstants.AUTH_KEYSPACE_NAME, LEGACY_USERS_TABLE); }