@Startup @ApplicationScoped public class AuthorizationPolicyDeployer extends Object
If located, the policy file is loaded and passed along the AuthorizationPolicyStorage
. The deployment
process is only executed once, so if a policy instance has been already stored then the deployment is left out.
The AuthorizationPolicyMarshaller
class is used to read and convert the entries defined at
the security-policy.properties file into an AuthorizationPolicy
instance.
It is also possible to split the policy into multiple files. The security-policy.properties file is always mandatory as it serves as a marker file. Alongside that file, several security-module-?.properties files can be created. The split mechanism allows either for the provision of just a single full standalone policy file or multiple module files each of them containing different entries. The way those files are defined is always up to the application developer.
Constructor and Description |
---|
AuthorizationPolicyDeployer() |
AuthorizationPolicyDeployer(AuthorizationPolicyStorage authzPolicyStorage,
PermissionManager permissionManager,
javax.enterprise.event.Event<AuthorizationPolicyDeployedEvent> deployedEvent) |
Modifier and Type | Method and Description |
---|---|
void |
deployPolicy() |
void |
deployPolicy(Path policyDir) |
Path |
getPolicyDir() |
void |
init() |
boolean |
isPolicyFile(Path p) |
AuthorizationPolicy |
loadPolicy(Path policyDir) |
void |
loadPolicyFile(NonEscapedProperties properties,
Path path) |
NonEscapedProperties |
readPolicyProperties(Path policyDir)
Put all the policy files together into a single properties instance.
|
public AuthorizationPolicyDeployer()
@Inject public AuthorizationPolicyDeployer(AuthorizationPolicyStorage authzPolicyStorage, PermissionManager permissionManager, javax.enterprise.event.Event<AuthorizationPolicyDeployedEvent> deployedEvent)
@PostConstruct public void init()
public void deployPolicy()
public Path getPolicyDir()
public void deployPolicy(Path policyDir)
public AuthorizationPolicy loadPolicy(Path policyDir)
public NonEscapedProperties readPolicyProperties(Path policyDir) throws IOException
policyDir
- The source directory where to read the policy files from.NonEscapedProperties
instance containing all the properties read from the policy files foundIOException
- When an IO error occurs reading any of the policy filespublic boolean isPolicyFile(Path p)
public void loadPolicyFile(NonEscapedProperties properties, Path path)
Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.