@Override public Credentials call() throws Exception { return tokenSecureStoreRenewer.createCredentials(); } });
/** * Static builder for constructing list of permissions. * * @return An instance of builder */ public static Builder builder() { return new Builder(); }
/** * Invoked by the {@link #builder()}. */ private Builder() { perms = new ApplicationPermissionCollection(); }
private void revokeAndAssertSuccess(final EntityId entityId) throws Exception { Authorizer authorizer = getAuthorizer(); authorizer.revoke(Authorizable.fromEntityId(entityId)); assertNoAccess(entityId); }
/** * Returns the minimum update interval for the delegation tokens. * @return The update interval in milliseconds. */ public long getUpdateInterval() { if (updateInterval == null) { // we want to lazily call this (as opposed to in the constructor), because sometimes we use an instance of // TokenSecureStoreRenewer without scheduling updates. For instance, when launching a program or from // ImpersonationHandler. updateInterval = calculateUpdateInterval(); } return updateInterval; }
private void set(RuntimePermission permission) { ApplicationSecurity.builder() .adminClass(this.getClass()) .add(permission) .apply(); }
@Override protected void configure() { addHandler(new PartitionHandler()); }
/** * Note that the impersonation is not actually happening since we do not have keytab files for unit test, * all impersonation doAs will be no-op, but we can still simulate the namespace deploy and app creation in the test */ @Test public void testCreationWithOwner() throws Exception { // this test will test deploy app without app owner specified. Like namespace impersonation testDeployAppWithoutOwner(); // this test will test deploy app with app owner specified. Like app impersonation testDeployAppWithOwner(); }
/** * Applies the permission. Replaces the security manager for the JVM if there * none set. */ public void apply() { System.setSecurityManager(new ApplicationSecurity(perms, klass)); } }
/** * @return builder to create a fake secure store. */ public static Builder builder() { return new Builder(); }
private void assertNoAccess(final EntityId entityId) throws Exception { assertNoAccess(ALICE, entityId); assertNoAccess(BOB, entityId); }
public FakeSecureStore build() { return new FakeSecureStore(values); } }
/** * Returns the minimum update interval for the delegation tokens. * @return The update interval in milliseconds. */ public long getUpdateInterval() { if (updateInterval == null) { // we want to lazily call this (as opposed to in the constructor), because sometimes we use an instance of // TokenSecureStoreRenewer without scheduling updates. For instance, when launching a program or from // ImpersonationHandler. updateInterval = calculateUpdateInterval(); } return updateInterval; }
@Override public Credentials call() throws Exception { return tokenSecureStoreRenewer.createCredentials(); } });
/** * Static builder for constructing list of permissions. * * @return An instance of builder */ public static Builder builder() { return new Builder(); }
/** * Invoked by the {@link #builder()}. */ private Builder() { perms = new ApplicationPermissionCollection(); }
/** * Applies the permission. Replaces the security manager for the JVM if there * none set. */ public void apply() { System.setSecurityManager(new ApplicationSecurity(perms, klass)); } }
private long calculateUpdateInterval() { return calculateUpdateInterval(yarnConf, secureExplore); }
private long calculateUpdateInterval() { return calculateUpdateInterval(yarnConf, secureExplore); }