public class SecurityClient extends CQClient
CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
Modifier and Type | Field and Description |
---|---|
protected static String |
ADMIN_URL |
protected static String |
LOGIN_URL |
LOG, STATISTICS_ROOT, wcmCommands
Constructor and Description |
---|
SecurityClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config) |
SecurityClient(URI serverUrl,
String user,
String password) |
Modifier and Type | Method and Description |
---|---|
Group |
createGroup(String groupId,
Group[] assignedGroups,
int... expectedStatus)
Creates a new group and assigns him to a list of given
Authorizable s. |
Group |
createGroup(String groupId,
int... expectedStatus)
Creates a new group.
|
Group |
createGroup(String groupId,
String intermediatePath,
int... expectedStatus)
Creates a new group.
|
Group |
createGroup(String groupId,
String intermediatePath,
String givenName,
String aboutMe,
Group[] assignedGroups,
int... expectedStatus)
Creates a new group and assigns him to a list of given
Authorizable s. |
User |
createUser(String userId,
int... expectedStatus)
Creates a new user with password the same as userId.
|
User |
createUser(String userId,
String intermediatePath,
int... expectedStatus)
Creates a new user with password the same as userId in a defined root path.
|
<T extends Group> |
createUser(String userId,
String password,
String intermediatePath,
Map<String,String> profileMap,
boolean waitForIndexing,
T[] assignedGroups,
int... expectedStatus)
Creates a new user with a
Profile and assigns him to a list
of given Authorizable s. |
<T extends Group> |
createUser(String userId,
String password,
String intermediatePath,
Map<String,String> profileMap,
T[] assignedGroups,
int... expectedStatus)
Creates a new user with a
Profile and assigns him to a list
of given Authorizable s. |
<T extends Group> |
createUser(String userId,
String password,
T[] assignedGroups,
int... expectedStatus)
Creates a new user and assigns him to a list of given
Authorizable s. |
void |
deleteAuthorizables(Authorizable[] authorizables,
int... expectedStatus)
Delete a list of authorizables.
|
String |
getAdminUrl()
URL for Security Admin
|
String |
getLoginTokenCookie(int... expectedStatus)
Get the login token cookie to authenticate future requests.
|
String |
getLoginUrl()
Get the login page
|
AuthorizableManager |
getManager()
Get
AuthorizableManager to get and create Authorizable s: User / Groups |
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, lockPage, movePage, movePage, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadAsset, uploadFileCQStyle
createFolder, createNode, createNodeRecursive, deletePath, doGetJson, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUUId, getUUID, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExists
adaptTo, addValue, close, doDelete, doGet, doGet, doGet, doHead, doPatch, doPost, doPost, doPut, doRawRequest, doRequest, doStreamGet, doStreamPost, doStreamRequest, execute, execute, execute, execute, execute, execute, execute, execute, getClientId, getConnectionManager, getCookieStore, getCredentialsProvider, getParams, getPassword, getPath, getPath, getUrl, getUrl, getUrl, getUser, getValue, getValues, hasValue
protected static final String LOGIN_URL
protected static final String ADMIN_URL
public SecurityClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
public String getLoginUrl()
public String getAdminUrl()
public AuthorizableManager getManager()
AuthorizableManager
to get and create Authorizable
s: User / GroupsAuthorizableManager
public void deleteAuthorizables(Authorizable[] authorizables, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
authorizables
- Authorizable
expectedStatus
- list of allowed HTTP Status to be returnedorg.apache.sling.testing.clients.ClientException
- if the request failedpublic User createUser(String userId, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
userId
- the user ID for the new user.expectedStatus
- list of allowed HTTP Status to be returnedUser
org.apache.sling.testing.clients.ClientException
- if the request failedInterruptedException
- to mark this method as "waiting"public User createUser(String userId, String intermediatePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
userId
- the user ID for the new user.intermediatePath
- the root path user will be created.expectedStatus
- list of allowed HTTP Status to be returned.User
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"public <T extends Group> User createUser(String userId, String password, T[] assignedGroups, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
Authorizable
s.T
- group typeuserId
- the user ID for the new user.password
- the password to be assigned.assignedGroups
- groups the user will be assigned to as Group
-Array.expectedStatus
- list of allowed HTTP Status to be returned.User
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"public <T extends Group> User createUser(String userId, String password, String intermediatePath, Map<String,String> profileMap, T[] assignedGroups, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
Profile
and assigns him to a list
of given Authorizable
s.T
- group typeuserId
- the user ID for the new user.password
- the password to be assigned.intermediatePath
- the root path user will be created.profileMap
- profile properties to be set for the new user.assignedGroups
- groups the user will be assigned to as Authorizable
-Array.expectedStatus
- list of allowed HTTP Status to be returned.User
org.apache.sling.testing.clients.ClientException
- If something fails during request/ response cycleInterruptedException
- to mark this method as "waiting"public <T extends Group> User createUser(String userId, String password, String intermediatePath, Map<String,String> profileMap, boolean waitForIndexing, T[] assignedGroups, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
Profile
and assigns him to a list
of given Authorizable
s.T
- group typeuserId
- the user ID for the new user.password
- the password to be assigned.intermediatePath
- the root path user will be created.profileMap
- profile properties to be set for the new user.waitForIndexing
- whether or not to wait for indexing to be completed after creating the userassignedGroups
- groups the user will be assigned to as Authorizable
-Array.expectedStatus
- list of allowed HTTP Status to be returned.User
org.apache.sling.testing.clients.ClientException
- If something fails during request/ response cycleInterruptedException
- to mark this method as "waiting"public Group createGroup(String groupId, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
groupId
- the group ID for the new group.expectedStatus
- list of allowed HTTP Status to be returned.Group
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"public Group createGroup(String groupId, String intermediatePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
groupId
- the group ID for the new group.intermediatePath
- the root path user will be created.expectedStatus
- list of allowed HTTP Status to be returned.Group
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"public Group createGroup(String groupId, Group[] assignedGroups, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
Authorizable
s.groupId
- the group ID for the new group.assignedGroups
- groups the user will be assigned to as Authorizable
-Array.expectedStatus
- list of allowed HTTP Status to be returned.Group
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"public Group createGroup(String groupId, String intermediatePath, String givenName, String aboutMe, Group[] assignedGroups, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
Authorizable
s.groupId
- the group ID for the new group.intermediatePath
- the root path user will be created.givenName
- the name of the group.aboutMe
- description of the group.assignedGroups
- groups the user will be assigned toexpectedStatus
- list of allowed HTTP Status to be returned.Group
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"public String getLoginTokenCookie(int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
expectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 302 (REDIRECT (to the requested resource)) is assumed.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleCopyright © 2018. All rights reserved.