Package com.tangosol.net.security
Class AuditingAuthorizer
java.lang.Object
com.tangosol.net.security.AuditingAuthorizer
- All Implemented Interfaces:
StorageAccessAuthorizer
Simple StorageAccessAuthorizer implementation that logs the authorization
requests and allows operations to proceed.
- Author:
- gg 2014.09.25
-
Field Summary
Fields inherited from interface com.tangosol.net.security.StorageAccessAuthorizer
REASON_AGGREGATE, REASON_CLEAR, REASON_ENTRYSET, REASON_GET, REASON_INDEX_ADD, REASON_INDEX_REMOVE, REASON_INTERCEPTOR_ADD, REASON_INTERCEPTOR_REMOVE, REASON_INVOKE, REASON_KEYSET, REASON_LISTENER_ADD, REASON_LISTENER_REMOVE, REASON_PUT, REASON_REMOVE, REASON_TRIGGER_ADD, REASON_TRIGGER_REMOVE, REASON_UNKNOWN, REASON_VALUES
-
Constructor Summary
ConstructorDescriptionConstruct a non-strict AuditingAuthorizer.AuditingAuthorizer
(boolean fStrict) Construct an AuditingAuthorizer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkRead
(BinaryEntry entry, Subject subject, int nReason) Check if the caller represented by the specified Subject is authorized to a read access for the specified entry.void
checkReadAny
(BackingMapContext context, Subject subject, int nReason) Check if the caller represented by the specified Subject is authorized to read any data.void
checkWrite
(BinaryEntry entry, Subject subject, int nReason) Check if the caller represented by the specified Subject is authorized to a write access for the specified entry.void
checkWriteAny
(BackingMapContext context, Subject subject, int nReason) Check if the caller represented by the specified Subject is authorized to update any data.protected void
logEntryRequest
(BinaryEntry entry, Subject subject, boolean fWrite, int nReason) Log the entry level authorization request.protected void
logMapRequest
(BackingMapContext context, Subject subject, boolean fWrite, int nReason) Log the backing map level authorization request.
-
Constructor Details
-
AuditingAuthorizer
public AuditingAuthorizer()Construct a non-strict AuditingAuthorizer. It will simply log the authorization request and allow the operation to proceed. -
AuditingAuthorizer
public AuditingAuthorizer(boolean fStrict) Construct an AuditingAuthorizer. It will simply log the authorization request and allow the operation to proceed based on the presence of the Subject.- Parameters:
fStrict
- if true, a non-null Subject must be presented for the operation to proceed
-
-
Method Details
-
checkRead
Description copied from interface:StorageAccessAuthorizer
Check if the caller represented by the specified Subject is authorized to a read access for the specified entry.- Specified by:
checkRead
in interfaceStorageAccessAuthorizer
- Parameters:
entry
- the entrysubject
- the SubjectnReason
- one of the REASON_* constants
-
checkWrite
Description copied from interface:StorageAccessAuthorizer
Check if the caller represented by the specified Subject is authorized to a write access for the specified entry.- Specified by:
checkWrite
in interfaceStorageAccessAuthorizer
- Parameters:
entry
- the entrysubject
- the SubjectnReason
- one of the REASON_* constants
-
checkReadAny
Description copied from interface:StorageAccessAuthorizer
Check if the caller represented by the specified Subject is authorized to read any data.For example, this check would be performed to install a
map listener
(except for lite listeners)- Specified by:
checkReadAny
in interfaceStorageAccessAuthorizer
- Parameters:
context
- the BackingMapContextsubject
- the SubjectnReason
- one of the REASON_* constants
-
checkWriteAny
Description copied from interface:StorageAccessAuthorizer
Check if the caller represented by the specified Subject is authorized to update any data.For example, this check would be performed to install a trigger.
- Specified by:
checkWriteAny
in interfaceStorageAccessAuthorizer
- Parameters:
context
- the BackingMapContextsubject
- the SubjectnReason
- one of the REASON_* constants
-
logEntryRequest
Log the entry level authorization request.- Parameters:
entry
- the entry to authorize access tosubject
- the SubjectfWrite
- true for write operation; read otherwisenReason
- the reason for the check
-
logMapRequest
protected void logMapRequest(BackingMapContext context, Subject subject, boolean fWrite, int nReason) Log the backing map level authorization request.- Parameters:
context
- the context of the backing map to authorize access tosubject
- the SubjectfWrite
- true for write operation; read otherwisenReason
- the reason for the check
-