Interface Authorizable
- All Known Implementing Classes:
AbstractAuthorizable
,Group
,User
public interface Authorizable
Interface which defines an authorizable: user / group
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final String
JSON propertiesstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Parameter marking the request being used for creating a new group.static final String
Parameter marking the request being used for creating a new user.static final String
Parameter indicating that the corresponding authorizable should be removed.static final String
static final String
static final String
static final String
static final String
static final String
JSON Schema from authorizable (minimum)static final String
Selector for AuthorizableServletstatic final String
Selector for UserPropertiesstatic final String
static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescription<T extends SecurityClient>
Authorizablecreate
(T client, Class<? extends AbstractAuthorizable> authorizableClass, String authorizableId, org.apache.sling.testing.clients.util.FormEntityBuilder formParameters, int... expectedStatus) Creates a newAuthorizable
.org.apache.sling.testing.clients.SlingHttpResponse
delete
(int... expectedStatus) Deletes an authorizable.boolean
exists()
Check if the authorizable existsGet any client implementing theSecurityClient
Get home path to authorizableGet home URL to authorizablegetId()
Get id of authorizableGet impersonators of the authorizable.getJsonAsString
(String propsFilter, int... expectedStatus) String representation of authorizable http://localhost:4502/home/groups/default/administrators.rw.json?props=replication,modification,memberOf, membersTotal,members,profile/*&ml=2000Get members authorizable is assigned to.Get members assigned to the authorizable.com.fasterxml.jackson.databind.JsonNode
Get profile attributes for authorizable.Get root path of the authorizable (user/group) in repositorygetUserPropertiesJsonAsString
(int... expectedStatus) Get user properties JSON representation as stringboolean
Check if authorizable is impersonated.
-
Field Details
-
SCHEMA_AUTHORIZABLE
-
SELECTOR
-
SELECTOR_USERPROPERTIES
-
PARAM_DELETE
Parameter indicating that the corresponding authorizable should be removed.- See Also:
-
PARAM_CREATE_USER
Parameter marking the request being used for creating a new user.- See Also:
-
PARAM_CREATE_GROUP
Parameter marking the request being used for creating a new group.- See Also:
-
ACTION_CREATE_USER
static final int ACTION_CREATE_USER- See Also:
-
ACTION_CREATE_GROUP
static final int ACTION_CREATE_GROUP- See Also:
-
PARAM_AUTHORIZABLE_ID
- See Also:
-
PARAM_PASSWORD
- See Also:
-
PARAM_INTERMEDIATE_PATH
- See Also:
-
PARAM_ADD_IMPERSONATORS
- See Also:
-
PARAM_REMOVE_IMPERSONATORS
- See Also:
-
PARAM_ADD_MEMBERS
- See Also:
-
PARAM_REMOVE_MEMBERS
- See Also:
-
AUTHORIZABLE_ID
-
HOME
- See Also:
-
IS_IMPERSONATED
- See Also:
-
MEMBERS
- See Also:
-
MEMBER_OF
- See Also:
-
PROFILE
- See Also:
-
IMPERSONATORS
- See Also:
-
TYPE
- See Also:
-
TYPE_GROUP
- See Also:
-
TYPE_USER
- See Also:
-
WILDCARD
- See Also:
-
-
Method Details
-
getClient
-
getId
-
getHomePath
-
getHomeUrl
-
getRootPath
String getRootPath()Get root path of the authorizable (user/group) in repository- Returns:
- root path
-
exists
Check if the authorizable exists- Returns:
- true if the authorizable exists
- Throws:
org.apache.sling.testing.clients.ClientException
- if the request failedInterruptedException
- if interrupted
-
getJsonAsString
String getJsonAsString(String propsFilter, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException String representation of authorizable http://localhost:4502/home/groups/default/administrators.rw.json?props=replication,modification,memberOf, membersTotal,members,profile/*&ml=2000- Parameters:
propsFilter
- properties filterexpectedStatus
- list of allowed HTTP Status to be returned.- Returns:
- the string representing a json
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycle
-
getUserPropertiesJsonAsString
String getUserPropertiesJsonAsString(int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Get user properties JSON representation as string- Parameters:
expectedStatus
- status to be- Returns:
- user properties JSON representation as String
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycle
-
delete
org.apache.sling.testing.clients.SlingHttpResponse delete(int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Deletes an authorizable.- Parameters:
expectedStatus
- list of allowed HTTP Status to be returned.- Returns:
- Sling response
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycle
-
create
<T extends SecurityClient> Authorizable create(T client, Class<? extends AbstractAuthorizable> authorizableClass, String authorizableId, org.apache.sling.testing.clients.util.FormEntityBuilder formParameters, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Creates a newAuthorizable
.- Type Parameters:
T
- client type- Parameters:
client
- any class implementing theSecurityClient
.authorizableClass
- Authorizable class to be created.authorizableId
- the ID for the new authorizable.formParameters
- form parameters.expectedStatus
- list of allowed HTTP Status to be returned. If not set, http status 201 (CREATED) is assumed.- Returns:
- created
Authorizable
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycle
-
getMemberOf
Map<String,Authorizable> getMemberOf() throws org.apache.sling.testing.clients.ClientException, InterruptedExceptionGet members authorizable is assigned to.- Returns:
- list of
Authorizable
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"
-
getMembers
Map<String,Authorizable> getMembers() throws org.apache.sling.testing.clients.ClientException, InterruptedExceptionGet members assigned to the authorizable.- Returns:
- list of
Authorizable
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"
-
isImpersonated
boolean isImpersonated() throws org.apache.sling.testing.clients.ClientExceptionCheck if authorizable is impersonated.- Returns:
- true if authorizable is impersonated.
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycle
-
getImpersonators
Map<String,Authorizable> getImpersonators() throws org.apache.sling.testing.clients.ClientException, InterruptedExceptionGet impersonators of the authorizable.- Returns:
- list of
Authorizable
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"
-
getProfile
com.fasterxml.jackson.databind.JsonNode getProfile() throws org.apache.sling.testing.clients.ClientExceptionGet profile attributes for authorizable.- Returns:
- JsonNode containing profile properties
- Throws:
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycle
-