See: Description
| Interface | Description |
|---|---|
| Authenticator |
This interface defines methods that provide a way to implement custom authentication logic.
|
| BitFlagsConstants |
A shared definition of bitflags-related constants.
|
| Cleanable |
Defines an interface for tokens in the security context that
implement finalization.
|
| Initializable |
The interface is implemented by classes to abstract out the instance initialization into
a separate callable unit.
|
| PasswordInput |
Interface the password change plugins should implement.
|
| Resource |
This package private interface defines the resource plugin registration
procedure.
|
| Rights |
This interface defines methods that can be applied to an instance
of rights.
|
| RightsEditor |
This interface defines methods that are called by the admin client's
Access Control List Management screen when editing ACLs.
|
| SecurityConstants |
A shared definition of security-related constants.
|
| SecurityManager.EncryptedKeyStoreFunction |
An interface to expose the
SecurityManager.CertificateSecurityManager.getEncryptedKeyStoreWorker(java.lang.String, java.lang.String, java.lang.String, com.goldencode.p2j.main.ServerKeyStore.Store) to threads
which have proper server context. |
| SsoAuthenticator |
Base interface for the SSO authentication hooks
|
| WeightedToken |
Interface marking a weighted security token.
|
| Class | Description |
|---|---|
| AbstractResource |
This abstract class partially implements the Resource interface.
|
| AccessControlList |
Associates a named instance of abstract resource with a list of bindings.
|
| Account |
Abstract class representing a security account.
|
| AccountExtUtil |
Wrapper class for account ext methods.
|
| AdminResource |
Implements the "admin" abstract resource.
|
| AdminResourceNamespace |
Admin resource namespace.
|
| AdminResourceNamespace.LeafNode |
Represents the leaf nodes in the namespace tree.
|
| AdminResourceNamespace.Node |
Represents nodes in the namespace tree.
|
| AdminRights |
Implements the "admin" rights objects.
|
| AssociatedThread |
Provides a thread which automatically inherits the security context of the thread that
instantiates it.
|
| Audit |
Provides controllable auditing capabilities for all security relevant
events.
|
| AuditTarget |
Represents a security audit target which is an instance of an abstract
resource.
|
| AuthData |
Storage of authentication data, as read from the remote side.
|
| AuthenticationResponse |
Simple container to store a subject ID and a return code.
|
| AuthPlugin |
Container object which keeps information about a custom authentication
plugin.
|
| BCCertFactory |
Implementation to generate SSL certificates and their private keys, using the Bouncy Castle
library.
|
| BCHolder |
BouncyCastle providers' holder.
|
| BCProbe |
BouncyCastle presence flag holder.
|
| Binding |
Associates an instance of Rights interface with an array of numeric subject
IDs.
|
| BitFlagsResource |
Implements the "bitFlags" resource.
|
| BitFlagsRights |
Implements the "bitflags" rights object.
|
| BitSet |
This class provides GWT-compatible bit set implementation, the usage of java.util.BitSet
breaks GWT serialization.
|
| BitSetHelper |
BitSet conversion methods.
|
| ContextAwareThread |
Provides a thread which automatically sets the security context for the duration of the core
logic execution.
|
| ContextKey |
Synthetic key for SecurityContext.
|
| ContextLocal<T> |
An implementation of a container for an arbitrary object reference, stored
context locally.
|
| ContextSwitcher |
Instance to allow a thread to switch context to another session.
|
| CSHolder |
Conscrypt provider holder.
|
| CSProbe |
Conscrypt presence flag holder holder.
|
| CustomHookSample |
This class is a sample of a custom authentication hook implementation.
|
| DatabaseAuthenticationHook |
This class is a database authentication hook implementation.
|
| Decision |
Cache and helpers to lookup cached decisions.
|
| DefaultLoginPanel |
Hard coded user interface which displays a prompt to obtain the login
credentials (userid and password).
|
| Description |
This class describes an item of the access rights.
|
| DigitalSignature |
A tool to sign messages and verify their signature for certain private : public key pair.
|
| EncryptBase64Value |
Utility program to read the given base64 text, convert it to binary, encrypt it and convert
it back to base64.
|
| FileSystemResource |
Implements the "FileSystemResource" resource.
|
| GroupAccount |
Represents a group which has specific rights and to which a list of other
subjects belongs.
|
| GuestAccess |
The class to request authentication to a specified user account without
providing password.
|
| HashPassword |
This class implements a password hashing public method and a command line
utility.
|
| KeyImport |
Implements arbitrary private key / certificate pair import into a keystore.
|
| LegacyWebSecurityManager |
Wrapper class for all method related to legacy services.
|
| LegacyWebSecurityManager.WebServiceLogin |
A thread inheriting the FWD server context, used to perform authentication and authorization work for
web requests.
|
| ManagedWebServer |
Represents the functionality to be able to start an instance of the managed web server that
responds on SNI requests to the subject provided by the ACME server in order to prove
the ownership of this host.
|
| ManagedWebServer.InputParameters |
Defines the managed web server input parameters.
|
| OsUserAccount |
Represents a specific OS user account.
|
| ProcessAccount |
Represents an application or server process account.
|
| RelatedThread |
Provides a thread which automatically inherits the account of the creating thread but uses a
"related" security context.
|
| Resolver |
This class implements a symbol (variables and functions) resolver
for the access rights expressions evaluator.
|
| ResourceRegistry |
Implements a registry of all abstract resource plugins.
|
| SampleSsoAuthenticator |
Sample implementation of the standard SSO authenticator hook.
|
| Search |
Represents open seaches initiated by calls to openRightsSearch().
|
| SecureSocketsRegistrar |
JCE/JSSE provider registrar
|
| SecurityAdmin |
This is a collection of workers that have to be in the security package
but used from the admin package.
|
| SecurityCache |
Security cache is a collection of control data that originates in the P2J
directory and/or the bootstrap configuration and is maintained in memory
for quick access.
|
| SecurityContext |
Security context is a collection of control data that associates subjects
with Access Control Lists in the directory.
|
| SecurityContextStack |
Security context stack is a mechanism of tracking security context switches
within a thread.
|
| SecurityManager |
This class is the core of P2J security management.
|
| SecurityManagerAuthenticator |
SecurityManager implementation of Authenticator interface moved to its own class.
|
| SecuritySession |
Package private class that maintains all per connection data.
|
| SecurityUtil |
Wrapper class for security util methods
|
| SelfSignedCertGen |
Generate a new root CA and a server certificates and save them and the associated private keys
in external key stores.
|
| SessionToken |
Unique object describing a security context, by its session ID and authenticated subject.
|
| SSLCertFactory |
Define APIs to generate SSL certificates and their private keys.
|
| SSLCertFactory.CertificateSuite |
Holds public and private certificates with trusted certificate chain up to a well-known CA.
|
| SSLCertGenUtil |
Generate new root CA and SSL certificates for all the accounts which authenticate via a
certificate and save them and the associated private keys in the directory.
|
| SSLCertGenUtil.BigIntegerOptionHandler |
Implements BigInteger option handler to get BigInterger from the decimal string.
|
| SSLCertGenUtil.EnumMapper<E extends java.lang.Enum<E>> |
Maps string key and value pairs into pairs with keys given by the provided enumeration type.
|
| SSLCertGenUtil.InputParameters |
SSLCertGenUtil input parameters
|
| SSLCertGenUtil.LoadCertificatesMapper |
Maps string key and value pairs into pairs with ExternalCertificates keys when these
parameters are parsed.
|
| SSLCertGenUtil.RequestInfoMapper |
Maps string key and value pairs into pairs with RequestInfo keys when request info
parameters are parsed.
|
| SSLHelper |
Provides static SSL processing convenience methods.
|
| SsoAuthenticator.LicensingData |
Wrapper class for all properties that can be used for enforcing licensing policy.
|
| SsoAuthenticator.Result |
Wrapper class for all properties needed by the FWD framework to respond to the auth / spawn request
|
| StringConditionResource |
Implements a resource that is protected by a single string that describes the condition
for which to allow access.
|
| StringConditionRights |
Implements the
StringConditionRights rights objects. |
| SymmetricEncryption |
Utility class that mimics the symmetric encryption of Progress'
genpassword utility. |
| SystemResource |
Implements the "system" abstract resource.
|
| SystemRights |
Implements the "system" rights objects.
|
| TransportSecurity |
Handles the setup of the JSSE environment to use a custom
KeyManager and TrustManager. |
| TrustedClientPlugin |
Custom authentication plugin that allows a user to be automatically logged
in (without password!) by specifiying the target user id when starting P2J
client.
|
| UserAccount |
Represents a specific user security account.
|
| VariablePool |
Implements Security Manager variables that may be used in access rights
expressions.
|
| WebCertificates |
Defines web certificates configuration manager.
|
| WebRequestContext |
Contains the state about an authorized web request.
|
| WebServiceResource |
Implements the resource to set permissions for web services.
|
| Enum | Description |
|---|---|
| SSLCertGenUtil.BooleanOption |
The enumeration type for boolean options
|
| SSLCertGenUtil.ExternalCertificates |
Defines option names to load external CA certificates.
|
| SSLCertGenUtil.RequestInfo | |
| SSLHelper.ErrorCode |
Detailed return codes.
|
| WeightFactor |
Enum defining the possible weight factors for context-local vars.
|
| Exception | Description |
|---|---|
| ContextLocalCleanupException | |
| RestrictedUseException |
An extension of the Exception that signals restricted access violations.
|
| SSLCertGenException |
Exception thrown when encountering problems during generation of SSL certificates.
|
| Author |
Nick Saxon Greg Shah |
| Date |
October 14, 2011 |
| Access Control |
CONFIDENTIAL |
setInitialSecurityContext() method.
Only a known method in
the com.goldencode.p2j.net package is allowed to call a Security
Manager API that
creates the initial security contexts.pushAndSwitchSecurityContext(Object)
to push its initial security
context on stack and create a new one, which corresponds to the
client's end of the connection. The client's security context is
determined by the nature of the TLS connection as follows. This
thread then initializes the networking components of the
com.goldencode.p2j.net package and starts those components. From
there, all incoming requests on that active connection are read by the
com.goldencode.p2j.net.Dispatcher which implements a thread pool that
services incoming requests.| Client |
Server |
As part of
initialization, the
server calls getServerTransportSecurity(AuthUIHelper)
method, which returns an instance of the TransportSecurity
class, embedding KeyManager and TrustManager
objects. The KeyManager manages the server's
certificate
and private key. The TrustManager manages the
certificates of the root authorities and, possibly, individual
certificates of clients and other servers. All this information
comes
from the P2J directory. |
|
The Listener
creates a secured
socket based on the TransportSecurity class and waits for
incoming connections. |
|
The Startup code
wants to create
a new session and calls the Security Manager's getClientTransportSecurity(AuthUIHelper)
method. |
|
The getClientTransportSecurity
method returns an instance of the TransportSecurity
class, embedding KeyManager and TrustManager
objects. The KeyManager manages the client's
certificate
and private key. The TrustManager
manages the certificates of the root authorities and the known
server(s). This
information comes from the bootstrap configuration. |
|
The Startup code
establishes a
secured TLS connection with the server, using the bootstrap
configuration and the TransportSecurity class. |
|
The Listener
accepts the
connection, gets the server side socket for it and calls the Security
Manager's authenticateLocal(SSLSocket) method. |
|
The Startup code
calls the
Security Manager's authenticateClient(SSLSocket,
AuthUIHelper) method. Security Manager verifies the
server's
certificate and terminates the connection if verification fails.
The
verification procedure is identical to what is described in RFC2830, section
3.6. |
|
| Both ends of the connection are temporarily under control of the Security Manager. | |
| Security Manager
waits for a
message from the server. |
Security Manager queries the database service and finds out the general authentication mode. The general authentication mode tells what type of client authentication is acceptable and, optionally, includes some additional configuration data like class name. Security Manager transmits the requested authentication mode and parameters down the link and waits for the authentication input. |
| Security Manager
receives the
requested authentication
mode and, depending on the authentication mode, either performs
requested action directly or calls the authentication hook. The
authentication message is sent to the server. The client waits
for the
authentication result. |
|
| Security Manager
verifies the
authentication input, produces and sends the authentication result. |
|
| Security Manager
receives the
result. |
|
| Security
Manager
relinquishes control of the link on both ends. If authentication
has
failed, the connection is terminated. |
|
authenticateLocal(SSLSocket)
method returns a unique context ID (which is a reference to a JVM
object) that may be used as a key to security context switches later. |
|
TransportSecurity class is a singleton.
Multiple TLS
connections are allowed.AuthUIHelper is an interface
that hides all user interface related actions from the Security
Manager. Such actions are asking the end user for used ID and
password,
if requested by the server. This interface provides methods that
return
needed pieces of input to the Security Manager.| Client |
Link |
Server |
| <-- |
authentication
request |
|
| authentication
message |
--> |
|
| <-- |
authentication
result |
|
Client |
Link |
Server |
| <-- |
authentication
result |
Authenticator
interface. The built-in authentication modes implement this
interface. The basis for custom logic in the authentication
hook is
that the both sides of the connection are given a chance to run the
specified class and use the secured connection to communicate with each
other.AuthUIHelper interface. setConfigItem("security", "authentication", "type", "program");
setConfigItem("access", "subject", "id", id);
setConfigItem("access", "password", "user", pw);
TransportSecurity class
on
the server can be used to create outgoing TLS connections as
well. This
technique authenticates this server as a certified process on the
remote server.getIdentity method and gets a
portable representation of the user's identity (in its simplest form,
it is a string with the user ID);authenticateRemote(String
identity) method;com.goldencode.p2j.security.AbstractResource class is
a partial implementation of the abstract resource. This class
implements the Resource interface. The
methods from
this interface are called by the Security Manager. They are:public void attach(SecurityManager)public String getTypeName()public void registeredAs(int)public Object getLibrary()null.
public Description[] describeRights();Description
objects which report the details about every field of the access rights
specific to the pluginpublic Rights getRightsInstance(Field[])Rights
interface constructed using the given array of Field
objectspublic boolean isInstanceNameValid(String)public boolean isRightsSetValid(Field[])AbstractResource class. This guarantees that
anything that has to be programmatically enforced, can be coded as a
final method in the base class.getTypeName(),
getLibrary(), registeredAs(int) and describeRights()
methods
to create a registry of resource types. This is how the plugins
become
known components of the security model. Other methods are
discussed
later.DatabaseResource
has
a method static boolean canSeeTable(String tableName)
which the application calls somewhere as 
DatabaseResource.canSeeTable("customers").
getTypeName()
method, it checks the registry for duplication. If no duplication
found, the Security Manager assigns a numeric resource type ID to this
plugin and calls its registeredAs(int) method. The
latter
lets the plugin know the Security Manager's assigned resource
type ID. During application calls for access rights
checks, the
plugin uses the resource type ID as a parameter for all Security
Manager method calls.
describeRights() method, which returns an array
of Description objects;Rights interface and
hides the implementation of rights;getRightsInstance() method, which creates
instances of Rights objects from an array of field
objects.Rights
interface no matter what plugin it calls, so it can handle the access
rights uniformly.Rights interface does not contain any methods.
The
implementing class, however, is something specific to the resource
plugin, and may implement methods as it seems appropriate to the plugin
implementors.int type;boolean type;BitSet);String type;byte[] type;Date type with the time
portion ignored and set to 0;Date type with the date
portion ignored and set to 0 (January 1, 1970, 00:00:00 GMT).Description objects. A Description
object contains information about:BitSet of unused bits.Field objects are used by the Security Manager as an
intermediate step in creating instances of Rights. Rights
are used in access rights checks and in P2J directory administration.Rights object, the Security Manager uses
the array of Description objects. For every Description
in the array, the corresponding instance of a field object is
created. A
field object is a ready to use
copy of an access rights field from the P2J directory. The type
of a
field object depends on the implementation of the primitive data type.
null
reference is used in such cases.Type "system"For every configured abstract resource type, there may be zero or one section.
ACLs for the resource type "system"
Type "database"
ACLs for the resource type "database"
...
rights
statement encodes the specific rights as a sequence of fields, as
described in Resource
Access Rights.
Type "database"Further, following the access rights is one or more groups of two statements:
Rights 4096, 1024, "true", 1
ACLs that share the rights above
Rights 4096, 1024, "false"
ACLs that share the rights above
...
subjects and resources.
The subjects
statement lists the subject names that have the rights defined above
with respect to the resources defined here. There must be one or
more
subject names. subjects statement for the subsection is allowed
this special form: all_others. This means that all
subjects not mentioned in the previous statements of this subsection
fall into this category. resources statements name instances of the resource
exactly, or
specify regular expressions for a set of matching instance names.
Due to this matching capability, the order of definitions is very
important. The lookup happens in the order the instances
appear
in the ACL. The first matching entry wins.Type "database"As externally defined in the P2J directory, the ACLs are not suitable for quick access. The Security Manager needs to do some translation. This is done at startup. The whole ACL definition is read and parsed. During this process:
Rights 4096, 1024, "true", 1
subjects u1, u2, g1
resources instance "abc"
subjects u3, g2
resources instance "xyz" match "ab[0-9]"
Rights 4096, 1024, "false"
subjects all_others
resources match "ab."
Rights 2048
subjects all_others
resources instance "xyz"
Rights (up front approach).Rights 4096, 1024, "true", 1The second step is to regroup the triplets under the resource instance/match.
subjects u1, u2, g1
instance "abc"
Rights 4096, 1024, "true", 1
subjects u3, g2
instance "xyz"
Rights 4096, 1024, "true", 1
subjects u3, g2
match "ab[0-9]"
Rights 4096, 1024, "false"
subjects all_others
match "ab."
Rights 2048
subjects all_others
instance "xyz"
Instance "abc"The third step is to merge triplets displaying the same instance/match ("xyz" in the ACL shown).
subjects u1, u2, g1
rights 4096, 1024, "true", 1
Instance "xyz"
subjects u3, g2
rights 4096, 1024, "true", 1
Match "ab[0-9]"
subjects u3, g2
rights 4096, 1024, "true", 1
Match "ab."
subjects all_others
rights 4096, 1024, "false"
Instance "xyz"
subjects all_others
rights 2048
/security/acl. At startup, the servers search this
path first and load all ACLs defined there, unconditionally./security/acls/server-ID where the server-ID portion is variable.
At startup, the servers search this path for a node with the server-ID name matching the
server's ID. If such a node exists in the directory, all ACLs defined
under it are loaded, too.
DatabaseResource
provides a method static boolean canSeeTable(String tableName).
The application calls it from somewhere as DatabaseResource.canSeeTable("customers").
The reference to DatabaseResource implicitly specifies
the resource type. The resource name is given explicitly as "customers".
The action is specified implicitly through the method name canSeeTable.
The same hypothetical plugin could have provided another method like checkTableAccess(String
tableName, int accessMode) where the requested rights would have
been explicitly coded as a method parameter.static getInstance() method is used to get
a reference to the plugin instance, which is a singleton, and then call
instance methods using that reference.getCachedDecision(int resourceId, string
instanceName, int mode) method of the Security Manager.
The mode
parameter is a value that should consistently map all possible
requested rights into integers. This call returns either null
or a Boolean. The null simply means
there
is no cached decision, otherwise the Boolean conveys what
has to be returned immediately. openRightsSearch(int
resourceId, string instanceName, int mode)
method.
This call makes the Security Manager discard any existing cache entry
for the case, look up the security database and create a temporary list
of references to Rights objects and insert the list
into the list of open searches together with the search parameters {resourceId,
instanceName, mode}. This call returns an integer which
can be
considered the search handle. The Rights objects
selected
to the list are the result of applying the security context check
policy to the ACLs. The number of the objects and their order
complies
with the policy, as described in Using
Security Context.Rights object from the list,
interacts with it and then either breaks out of the loop or continues
until the list is empty. The plugin has to be prepared to receive
no Rights
objects at all as a valid case.Rights object from the list, the plugin
calls the getNextRights(int handle) method which returns
either Rights or null. Once an
instance of the Rights object is obtained, the plugin is
free to utilize any custom interface that may exist to get the rights
evaluation done. It is up to the plugin to decide where, when and
if to
break out of the loop or continue checks. One particular case is
worth
mentioning. If the plugin decides to provide a so called negative permission or veto, this is how it can be
implemented. A negative permission means the access is explicitly
denied and no other checks are to be made. The plugin simply
breaks out
of the loop to implement it.closeRightsSearch(int handle,
boolean
decision, boolean cache) method, the plugin tells the
Security Manager to do the necessary cleanup and, at the same
time it posts the final decision and whether the Security Manager
should cache the result or not. The Security Manager
destroys the
temporary list of the Rights object and removes the
associated item from the open searches list. If caching is
requested,
it turns this item into a cache entry.
Rights
with the expression so that the symbol resolver obtains the values of
variables from that instance of Rights. Rights.
It is compiled and evaluated immediately.Rights object and
decides whether the default expression is applicable. Either the
default or a newly built expression is compiled and evaluated. getLibrary()
method.getVariableName or isVariableName without
parameters, where VariableName matches the variable name and is
case-insensitive. The type of the returned value of the method
determines the type of the variable.getFunctionName or isFunctionName with
parameters, where FunctionName matches
the function name and is case-insensitive. The type of the returned
value of the method determines the type of the function.compute()
or evaluate()
method of the Security Manager passing it an instance of Rights
that supplies the backing data.associate(Rights) method of
the plugin to make a temporary association of the Rights
with the library. The plugin stores the reference into a thread local
object to avoid multithreading problems. The final implementation of
this method is provided in the AbstractResource base class.Rights object to produce values
for variables and functions. Methods can use getRights()
call to get to the Rights object. disassociate() method of the
plugin to break the temporary association of the Rights
with the library. The plugin nullifies the reference to help let that
instance go. The final implementation of this method is provided
in the AbstractResource base class. openRightsSearch.
Now the resource plugin can issue an internal check for the parent
resource: "/a/b". This check returns the rights X, so the only
thing
that is left to do is to use X as if it was returned for "/a/b/c".logoncontextchangeshutdowndebug
logon instance represents the abstract ability to log
onto the P2J
system. Authentication procedure checks the subject's access
rights on
the logon instance and only allows logon if the check
succeeds.
This
resource instance allows for a very flexible control over the logon
availability. context instance helps in auditing of the context
switch category of the security relevant events. See Auditing for details.change instance controls the access to the P2J
directory editing. Only those subjects having access to this instance,
can successfully open an editing batch.shutdown instance controls application access to the
programmatic server shutdown feature.debug instance controls application access to the
current debug level variable. The higher the variable value, the more
verbose debug output is produced. See Debugging
for details.system resource type may
be
added later.system resource comes with a simple structure of
access rights,
made of just one field. Here comes the description.| Field's primitive data type | string |
| Is it optional or mandatory? | mandatory |
| Is it variable or fixed size? | variable |
| Field's size | unlimited |
| Field's displayable label | "check" |
| Field's descriptive text | an arbitrary logical expression
that, if evaluated to "true", allows access |
| Bitfield's array of bit names | n/a |
Bitfield's BitSet
of unused bits |
n/a |
system resource named context
is introduced to allow security context related events to be
selectively audited like any other resource./security/audit/logfile/security/audit/logsize/security/audit/logcount/security/audit/enabled
value should be set to true.
| /security (container) | single object |
|
config
(container)
|
single object |
|
resource-plugins
(strings)
|
single object |
|
auth-mode
(authmode)
|
single object |
|
accounts
(container)
|
single object |
|
users
(container)
|
single object |
|
userID
(user)
|
one object per user name |
|
account
extensions
|
one or more user account
extension objects |
|
groups
(container)
|
single object |
|
groupID
(group)
|
one object per group name |
|
processes
(container)
|
single object |
|
processID
(process)
|
one object per server or application name |
|
account
extensions
|
one or more process account extension objects |
|
certificates (container)
|
single object |
|
peers
(container)
|
single object |
|
alias
(bytes)
|
one object per certificate owner name (alias) |
|
CAs
(container)
|
single object |
|
alias
(bytes)
|
one object per CA certificate owner name (alias) |
|
audit (container)
|
single object |
|
enabled (boolean)
|
single object; the value set to
true enables audit |
|
logfile (string)
|
single object; pattern for log
file names |
|
logsize (integer)
|
single object; size of log file
in K |
|
logcount (integer)
|
singleobject; number of log files |
|
filterMode (booleanOption)
|
single object |
|
subjects (strings)
|
single object |
|
resources (container)
|
single object |
|
(auditResource)
|
one object per auditable resource instance |
|
decisions (auditDecision)
|
single object |
|
acl
(container)
|
single object |
|
resource
type (container)
|
one object per resource type name |
|
seqno
(resourceRights)
|
one object per Rights line in ACL, ordered by seq |
|
seqno
(strings)
|
one object per list of subjects,
ordered by seq |
|
seqno
(binding)
|
one object per resource instance, ordered by seq |
|
acls
(container)
|
single object |
|
server-ID
(container)
|
optional; one object per server
needing specific ACLs |
|
resource
type (container)
|
one object per Rights line in ACL, ordered by seq |
|
seqno
(resourceRights)
|
one object per list of subjects, ordered by seq |
|
seqno
(binding)
|
one object per resource instance, ordered by seq |
|
holidays
(dates)
|
single object with one value per
holiday |
Definitions
objects. See
Directory
Service document for samples
(systemRights and directoryRights).AuthUIHelper interface.system resource named debug
is used for access rights check. Some messages may appear before
any user can get a chance to log on, like those related to the P2J
directory reading and interpretation. In this case, the default debug
level is set soon after the server starts up, based on the server's own
account permissions. AuthUIHelper getClientTransportSecurity(AuthUIHelper)
or getServerTransportSecurity(AuthUIHelper)
methods. The methods of the interface should provide
pieces of
information like user ID and various passwords.
| Method Signature |
Description |
public
char[] getKeyStorePassword(); |
Returns the password that
unlocks the key store. |
public
char[] getTrustStorePassword(); |
Returns the password that unlocks the trust store. |
public
char[] getAliasPassword(String alias);
|
Returns the password that
unlocks a specific key entry identified by alias. |
public String
getUserId(); |
Returns a string that represents
the identification of the user. |
public char[]
getUserPassword(); |
Returns the user's password. |
Authenticator
This interface is implemented by the built in
authorization modes and authentication hooks.
| Method Signature |
Description |
public
byte[] clientAuthHook(AuthUIHelper auth, String parameters); |
Implements client side custom
authorization logic. Returns a byte array to be transmitted to
the
server as authorization input. May use the given instance of AuthUIHelper
to get passwords, and custom parameters. |
public
String serverAuthHook(byte[] auth, String parameters);
|
Implements server side custom
authorization logic. Accepts the byte array produced by the
client side
authorization hook as the authentication input, and custom
parameters.
Returns a user ID (positive authentication) or null
(failed to authenticate). |
public void
clientFinalize(); |
Finalizes any resources
allocated during authentication by the client. |
Rights
This interface has no methods. It must be implemented by a
class
from a resource plugin package.Resource
This interface defines the resource plugin registration
procedure.| Method Signature |
Description |
public
void attach(SecurityManager); |
Notifies the plugin about the
instance of the Security Manager to communicate with. |
public
String getTypeName(); |
Returns the plugin resource type
as a string. |
public Object
getLibrary(); |
Returns an instance of a library
class for the plugin's own symbol
resolution if the plugin exports any variables or functions for use in
expressions, otherwise null. |
public void
registeredAs(int); |
Notifies the plugin that the
resource type has been assigned a numeric value. |
public Description[]
describeRights(); |
Returns an array of
descriptions, one object per the plugin's access rights item. |
public Rights
getRightsInstance(Object[]); |
Instantiates a plugin's class
that implements the Rights interface, using the array of
objects representing a set of access rights fields. Returns the
reference to the interface. |
public boolean
isInstanceNameValid(String); |
Checks whether a given string is
a syntactically valid resource name for this resource type. |
public boolean
isRightsSetValid(Object[]); |
Checks whether a given array of
objects representing a set of access rights fields is acceptable. |
AbstractResource
Resource interface. The resource plugins
should
extend this base class instead of implementing the Resource
interface directly.TransportSecurity
| Method Signature |
Description |
public
void attach(SSLContext); |
Initializes the given SSLContext
object so that the latter uses the key manager and the trust manager
embedded into this TransportSecurity class. |
SecurityManager
| Method Signature |
Description |
public static SecurityManager
createInstance(BootstrapConfig); |
Creates and returns an
instance of
SecurityManager class based on a given BootstrapConfig
object |
public static SecurityManager
getInstance(); |
Returns an instance of
SecurityManager class. |
public
TransportSecurity getClientTransportSecurity(AuthUIHelper); |
Creates an initialized instance
of the TransportSecurity class by request
from the client startup code. |
public
TransportSecurity getServerTransportSecurity(AuthUIHelper); |
Creates an initialized instance
of the TransportSecurity class by request
from the server startup code. |
| Method Signature |
Description |
public
boolean authenticateClient(SSLSocket,
AuthUIHelper); |
Restricted. Access is
limited to a specific calling class/method only. Triggers the user authentication on the client. Returns the authentication result. |
public
Object authenticateLocal(SSLSocket); |
Restricted. Access is
limited to a specific calling class/method only. Triggers the user authentication on the server. Returns the authentication result as an object reference (positive) or null
(negative). The returned object is a key to security context
switching. |
public
String getUserId(); |
Returns the effective subject ID
from the current security context. It is the user ID if a user is
logged on, otherwise the process ID. This method is in support of the PROGRESS' USERID() builtin function. |
public
String getIdentity(Object); |
Restricted. Access is
limited to a specific calling class/method only. Returns the subject identification using the result of authentication as the key. |
public
Object authenticateRemote(String); |
Restricted. Access is
limited to a specific calling class/method only. Registers the given user as authenticated. Returns the authentication result as an object reference. The returned object is a key to security context switching. |
public
void terminateSession(Object); |
Restricted. Access is
limited to a specific calling class/method only. Signals the TLS connection termination. If the session's security context has the use count of 0, the security context is deleted immediately. Otherwise, it's marked as "Pending Termination". |
| Method Signature |
Description |
public
void setInitialSecurityContext(); |
Restricted. Access is
limited to a specific calling class/method only. Server threads call this method at startup. The calling thread has to have no security context. |
public
void pushAndSwitchSecurityContext(Object); |
Server threads call this method
to temporarily switch to a user context to serve the associated
request. The calling thread has to have the initial security
context. If the target security context is marked as "Pending Termination", an exception is thrown as a result. Otherwise, the use count for the target security context is incremented by 1. |
public
void popAndRestoreSecurityContext(); |
Server threads call this method
to restore their initial security context when they are done with the
user request. The calling thread has to have its security context
switched to a user context prior to this call. The use count for the current security context is decremented by 1. If it becomes 0 and the security context is marked as "Pending Termination", it is deleted immediately. |
| Method Signature |
Description |
public
boolean addToken(String name, Object token); |
Restricted. Token
names starting with "system" are of restricted use. Token is saved in a storage associated with the current security context under the given name. |
public
boolean removeToken(String name); |
Restricted. Token
names starting with "system" are of restricted use. The named token is peranently removed from the current security context. |
public
boolean hasToken(String name); |
Restricted. Token
names starting with "system" are of restricted use. Checks whether the named token is in the current security context. |
public
Object getToken(String name); |
Restricted. Token
names starting with "system" are of restricted use. Gets the named token from the current security context. |
| Method Signature |
Description |
public AbstractResource
getPluginInstance(String resourceTypeName); |
Searches abstract resource
registry for a plugin that is responsible for the resources of the
specified type and returns its instance. Application calls this method
to get the instance of a plugin. |
public
Boolean getCachedDecision(int resourceId, String
instanceName, int mode); |
Returns a Boolean
with the decision or null if not available. Plugins call this method to check whether a cached access check decision is available. Cached access check decisions are identified by triplets of {resourceId, instanceName, mode} exactly as they were specified when the decision was taken. |
public
int openRightsSearch(int
resourceId, String instanceName, int mode); |
Returns a search handle.
Plugins
call this method to initiate the access rights search for the specified
resource instance and requested rights. |
public Rights
getNextRights(int handle); |
Returns an instance of Rights
interface to be used next in the access rights check loop.
Plugins cast Rights to their own classes and use their
custom
methods to perform the check. |
public void
closeRightsSearch(int handle, boolean
decision, boolean cache); |
Plugins call this method to
trigger cleanup of all temporary objects related to the search and
notify the Security manager about the decision just made and whether it
has to be cached or not. |
public synchronized
Double compute(int resourceId, Rights rights, String expr); |
Computes an arithmetic
expression using the backing data from the specified instance of Rights. |
public synchronized
Boolean evaluate(int resourceId, Rights rights, String
expr); |
Evaluates a logical expression
using the backing data from the specified instance of Rights.
|
| Method Signature |
Description |
public
boolean openBatch(); |
Restricted. Access is
limited to a specific calling class/method only. Returns true
if an editing batch has been opened. Fails if another batch is
open for
the calling thread. |
public
boolean isEditing(); |
Restricted. Access is
limited to a specific calling class/method only. Returns true
if an editing batch is currently open. |
public boolean
closeBatch(boolean disposition); |
Restricted. Access is
limited to a specific calling class/method only. Closes the currently open editing batch. The disposition parameter tells what to do with the closed batch:
true
if the requested disposition has been successfully applied. |
| Method Signature |
Description |
public Integer
getExtInteger(String extName); |
Finds the specified integer
account extension for the current user and returns the value or null. |
public
Boolean getExtBoolean(String extName); |
Finds the specified boolean
account extension for the current user and returns the value or null. |
public
String getExtString(String extName); |
Finds the specified string
account extension for the current user and returns the value or null.
|
public
byte[] getExtBytes(String extName); |
Finds the specified bytearray
account extension for the current user and returns the value or null.
|
public Integer
getExtInteger(String extName, String subjectId); |
Finds the specified integer
account extension for the specified user and returns the value or null.
|
public
Boolean getExtBoolean(String extName, String subjectId); |
Finds the specified boolean
account extension for the specified user and returns the value or null.
|
public
String getExtString(String extName, String subjectId); |
Finds the specified string
account extension for the specified user and returns the value or null. |
public byte[]
getExtBytes(String extName, String subjectId); |
Finds the specified bytearray
account extension for the specified user and returns the value or null. |
public boolean
setExtInteger(String extName, int value); |
Sets the specified integer
account extension for the current user. |
public
boolean setExtBoolean(String extName, boolean value); |
Sets the specified boolean
account extension for the current user. |
public
boolean setExtString(String extName, String value); |
Sets the specified string
account extension for the current user. |
public boolean
setExtBytes(String extName, byte[] value); |
Sets the specified bytearray
account extension for the current user. |
public boolean
setExtInteger(String extName, String subjectId, int value); |
Sets the specified integer
account extension for the specified user. |
public
boolean setExtBoolean(String extName, String subjectId, boolean value); |
Sets the specified boolean
account extension for the specified user. |
public boolean
setExtString(String extName, String subjectId, String value); |
Sets the specified string
account extension for the specified user. |
public boolean
setExtBytes(String extName, String subjectId, byte[] value); |
Sets the specified bytearray
account extension for the specified user. |
| Category |
Variable |
Description |
| Session |
Various
values taken from the current session environment. |
|
| String userid |
User identity |
|
| String groupid |
First or only group identity or
empty string |
|
| String appid |
Application identity |
|
| String groups |
Number of groups this user
account has been assigned to |
|
| int peerip |
Peer's IP Address |
|
| int serverip |
Server's IP Address |
|
| String peername |
Peer's hostname |
|
| String servername |
Server's hostname |
|
| boolean secureConnection | true if the socket is SSL/TLS based, false if an insecure socket is in use for this session. | |
| int peernode |
Peer's P2J node address |
|
| int servernode |
Server's P2J node address |
|
| Calendar/Date |
Various
forms of the current date |
|
| String date |
Current date as in "YYYY/MM/DD",
suitable for comparisons |
|
| int year |
Current year like 2005 |
|
| int month |
Current month 1-12 |
|
| int dayofmonth |
Current day of the month 1-31 |
|
| int dayofyear |
Current day of the year 1-365 |
|
| int dayofepoch |
Current day of the epoch, 0 =
Jan 1, 1970 |
|
| int weekday |
Current day of the week, sun=0,
mon=1 etc. |
|
| int weeknum |
Current week number 1-52 |
|
| boolean holiday |
Today is a holiday (true) or a
workday (false). The implementation relies upon the P2J directory
object /security/holidays which lists all holidays |
|
| Time of day |
Various
forms of the time of day |
|
| String time |
Current time of day as in
"HH:MM:SS" from "00:00:00" to "23:59:59" |
|
| int hourampm |
Current hour 1-12 |
|
| int hour |
Current hour 0-23 |
|
| int minute |
Current minute 0-59 |
|
| int second |
Current second 0-59 |
|
| boolean AM |
Current time is AM (true) |
|
| boolean PM |
Current time is PM (true) |
|
| int minSinceMidnight | Current minute since midnight
0-1439 |
|
| int secSinceMidnight | Current second since midnight
0-86399 |
|
| Miscellaneous | ||
| int debuglevel |
requested debug level or -1;
useful in expressions controlling access to the debugging feature (debug
instance of the system resource) |
|
| Category |
Function |
Description |
| Miscellaneous |
||
| String group(int n) | Returns the name of the nth group
the user has been assigned to |
|
| Directory Access |
Functions
querying various directory keys. The
returned type is the type of the directory key. |
|
| String dirs(String oid, String
attr) |
Queries the first value of a P2J attribute which specifies a string | |
| String dirs(String oid, String attr, int i) | Queries the specified value of a P2J attribute which specifies a string | |
| long dirl(String oid, String attr) | Queries the first value of a P2J
key which
specifies a long integer |
|
| long dirl(String oid, String attr, int i) | Queries the specified value of a
P2J attribute which
specifies a long integer |
|
| boolean dirb(String oid, String
attr) |
Queries the first value of a P2J
key which
specifies a boolean |
|
| boolean dirb(String oid, String attr, int i) | Queries the specified value of a
P2J attribute which
specifies a boolean |
|