Package io.toro.martini
Class ApiMethods
- java.lang.Object
-
- io.toro.martini.ApiMethods
-
public final class ApiMethods extends Object
it allows to add usernames, groupnames, and authentication types security for api service such asREST, SOAP API
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPI_FILE_EXTENSION
-
Constructor Summary
Constructors Constructor Description ApiMethods(MartiniPackageProvider packageProvider, io.toro.martini.permissions.AccessControlService accessControlService)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddApiAuthType(String namespace, String authType)Add authentication type to the API service within current package Authentication types:static voidaddApiAuthType(String packageName, String namespace, String authType)Add authentication type to the API service within a specific package by providing thepackageNameAuthentication types:static voidaddApiAuthTypes(String packageName, String namespace, List<String> authTypes)Add authentication types to the API service within a specific package by providing thepackageNameAuthentication types:static voidaddApiAuthTypes(String namespace, List<String> authTypes)Add authentication types to the API service within the current package Authentication types:static voidaddApiGroup(String namespace, String groupName)Add groupName authentication to the API service within current packagestatic voidaddApiGroup(String packageName, String namespace, String groupName)Add groupName authentication to the API service within a specific package by providing thepackageNamestatic voidaddApiGroups(String packageName, String namespace, Set<String> groupNames)Add groupNames authentication to the API service within a specific package by providing thepackageNamestatic voidaddApiGroups(String namespace, Set<String> groupNames)Add groupNames authentication to the API service within the current packagestatic voidaddApiUser(String namespace, String username)Add username to the API service within the current packagestatic voidaddApiUser(String packageName, String namespace, String username)Add username authentication to the API service within a specific package by providing thepackageName.static voidaddApiUsers(String packageName, String namespace, Set<String> usernames)Add usernames authentication to the API service within a specific package by providing thepackageNamestatic voidaddApiUsers(String namespace, Set<String> usernames)Add usernames authentication to the API service within a specific package.static voidremoveApiAuthType(String namespace, String authType)Remove authentication type to the API service within the current package Authentication types:static voidremoveApiAuthType(String packageName, String namespace, String authType)Remove authentication type to the API service within a specific package by providing thepackageNameAuthentication types:static voidremoveApiAuthTypes(String packageName, String namespace, List<String> authTypes)Remove authentication types to the API service within a specific package by providing thepackageNameAuthentication types:static voidremoveApiAuthTypes(String namespace, List<String> authTypes)Remove authentication types to the API service within the current package Authentication types:static voidremoveApiGroup(String namespace, String groupName)Remove groupName authentication to the API service within current packagestatic voidremoveApiGroup(String packageName, String namespace, String groupName)Remove groupName authentication to the API service within a specify package by providing thepackageNamestatic voidremoveApiGroups(String packageName, String namespace, List<String> groupNames)Remove groupNames authentication to the API service within a specify package by providing thepackageNamestatic voidremoveApiGroups(String namespace, List<String> groupNames)Remove groupNames authentication to the API service within the current packagestatic voidremoveApiUser(String namespace, String username)Remove username authentication to the API service within the current packagestatic voidremoveApiUser(String packageName, String namespace, String username)Remove username authentication to the API service within a specific package by providing thepackageName.static voidremoveApiUsers(String packageName, String namespace, List<String> usernames)Remove usernames authentication to the API service within a specific package by providing thepackageName.static voidremoveApiUsers(String namespace, List<String> usernames)Remove usernames authentication to the API service within the current
-
-
-
Field Detail
-
API_FILE_EXTENSION
public static final String API_FILE_EXTENSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ApiMethods
@Autowired ApiMethods(MartiniPackageProvider packageProvider, io.toro.martini.permissions.AccessControlService accessControlService)
-
-
Method Detail
-
addApiAuthType
public static void addApiAuthType(@GloopParameter(allowNull=false) String namespace, @GloopParameter(choices={"NONE","BASIC","OAUTH2"},allowNull=false) String authType) throws GloopException
Add authentication type to the API service within current package Authentication types:NONE
BASIC
OAUTH2
Note: Adding
NONEas authentication type will remove all the types- Parameters:
namespace- - the namespace of the api serviceauthType- - the authentication type to be added- Throws:
GloopException- - if the api service is not found
-
addApiAuthType
public static void addApiAuthType(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, @GloopParameter(choices={"NONE","BASIC","OAUTH2"},allowNull=false) String authType) throws GloopException
Add authentication type to the API service within a specific package by providing thepackageNameAuthentication types:NONE
BASIC
OAUTH2
Note: Adding
NONEas authentication type will remove all the types- Parameters:
packageName- - specify the package namenamespace- - the namespace of the api serviceauthType- - the authentication type to be added- Throws:
GloopException- - if the api service is not found
-
addApiAuthTypes
public static void addApiAuthTypes(@GloopParameter(allowNull=false) String namespace, @GloopParameter(choices={"NONE","BASIC","OAUTH2"},allowNull=false) List<String> authTypes) throws GloopException
Add authentication types to the API service within the current package Authentication types:NONE
BASIC
OAUTH2
Note: Adding
NONEauthentication type will remove all the types- Parameters:
namespace- - the namespace of the api serviceauthTypes- - the authentication types to be added- Throws:
GloopException- - if the api service is not found
-
addApiAuthTypes
public static void addApiAuthTypes(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, @GloopParameter(choices={"NONE","BASIC","OAUTH2"},allowNull=false) List<String> authTypes) throws GloopException
Add authentication types to the API service within a specific package by providing thepackageNameAuthentication types:NONE
BASIC
OAUTH2
Note: Adding
NONEauthentication type will remove all the types- Parameters:
packageName- - specify the package namenamespace- - the namespace of the api serviceauthTypes- - the authentication types to be added- Throws:
GloopException- - if the api service is not found
-
addApiUser
public static void addApiUser(@GloopParameter(allowNull=false) String namespace, String username) throws GloopException
Add username to the API service within the current package- Parameters:
namespace- - the namespace of the api serviceusername- - the username to be added- Throws:
GloopException- - if the api service is not found
-
addApiUser
public static void addApiUser(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, String username) throws GloopException
Add username authentication to the API service within a specific package by providing thepackageName.- Parameters:
packageName- - specify the package namenamespace- - the namespace of the api serviceusername- - the username to be added- Throws:
GloopException- - if the api service is not found
-
addApiUsers
public static void addApiUsers(@GloopParameter(allowNull=false) String namespace, Set<String> usernames) throws GloopException
Add usernames authentication to the API service within a specific package.- Parameters:
namespace- - the namespace of the api serviceusernames- - the usernames to be added- Throws:
GloopException- - if the api service is not found
-
addApiUsers
public static void addApiUsers(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, Set<String> usernames) throws GloopException
Add usernames authentication to the API service within a specific package by providing thepackageName- Parameters:
packageName- - specify the package namenamespace- - the namespace of the api serviceusernames- - the usernames to be added- Throws:
GloopException- - if the api service is not found
-
addApiGroup
public static void addApiGroup(@GloopParameter(allowNull=false) String namespace, String groupName) throws GloopException
Add groupName authentication to the API service within current package- Parameters:
namespace- - the namespace of the api servicegroupName- - the groupName to be added- Throws:
GloopException- - if the api service is not found
-
addApiGroup
public static void addApiGroup(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, String groupName) throws GloopException
Add groupName authentication to the API service within a specific package by providing thepackageName- Parameters:
namespace- - the namespace of the api servicegroupName- - the groupName to be added- Throws:
GloopException- - if the api service is not found
-
addApiGroups
public static void addApiGroups(@GloopParameter(allowNull=false) String namespace, Set<String> groupNames) throws GloopException
Add groupNames authentication to the API service within the current package- Parameters:
namespace- - the namespace of the api servicegroupNames- - the groupname to be added- Throws:
GloopException- - if the api service is not found
-
addApiGroups
public static void addApiGroups(String packageName, @GloopParameter(allowNull=false) String namespace, Set<String> groupNames) throws GloopException
Add groupNames authentication to the API service within a specific package by providing thepackageName- Parameters:
namespace- - the namespace of the api servicegroupNames- - the groupname to be added- Throws:
GloopException- - if the api service is not found
-
removeApiUser
public static void removeApiUser(@GloopParameter(allowNull=false) String namespace, String username) throws GloopException
Remove username authentication to the API service within the current package- Parameters:
namespace- - the namespace of the api serviceusername- - the username to be removed- Throws:
GloopException- - if the api service is not found
-
removeApiUser
public static void removeApiUser(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, String username) throws GloopException
Remove username authentication to the API service within a specific package by providing thepackageName.- Parameters:
packageName- - specify the package namenamespace- - the namespace of the api serviceusername- - the username to be removed- Throws:
GloopException- - if the api service is not found
-
removeApiUsers
public static void removeApiUsers(@GloopParameter(allowNull=false) String namespace, List<String> usernames) throws GloopException
Remove usernames authentication to the API service within the current- Parameters:
namespace- - the namespace of the api serviceusernames- - the username to be removed- Throws:
GloopException- - if the api service is not found
-
removeApiUsers
public static void removeApiUsers(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, List<String> usernames) throws GloopException
Remove usernames authentication to the API service within a specific package by providing thepackageName.- Parameters:
packageName- - specify the package namenamespace- - the namespace of the api serviceusernames- - the usernames to be removed- Throws:
GloopException- - if the api service is not found
-
removeApiGroup
public static void removeApiGroup(@GloopParameter(allowNull=false) String namespace, String groupName) throws GloopException
Remove groupName authentication to the API service within current package- Parameters:
namespace- - the namespace of the api servicegroupName- - the groupName to be removed- Throws:
GloopException- - if the api service is not found
-
removeApiGroup
public static void removeApiGroup(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, String groupName) throws GloopException
Remove groupName authentication to the API service within a specify package by providing thepackageName- Parameters:
namespace- - the namespace of the api servicegroupName- - the groupName to be removed- Throws:
GloopException- - if the api service is not found
-
removeApiGroups
public static void removeApiGroups(@GloopParameter(allowNull=false) String namespace, List<String> groupNames) throws GloopException
Remove groupNames authentication to the API service within the current package- Parameters:
namespace- - the namespace of the api servicegroupNames- - the groupNames to be removed- Throws:
GloopException- - if the api service is not found
-
removeApiGroups
public static void removeApiGroups(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, List<String> groupNames) throws GloopException
Remove groupNames authentication to the API service within a specify package by providing thepackageName- Parameters:
namespace- - the namespace of the api servicegroupNames- - the groupNames to be removed- Throws:
GloopException- - if the api service is not found
-
removeApiAuthType
public static void removeApiAuthType(@GloopParameter(allowNull=false) String namespace, @GloopParameter(choices={"BASIC","OAUTH2"},allowNull=false) String authType) throws GloopException
Remove authentication type to the API service within the current package Authentication types:NONE
BASIC
OAUTH2
Note: It will remove all the authentication type if the
authTypeisNONE- Parameters:
namespace- - the namespace of the api serviceauthType- - the authentication types to be added- Throws:
GloopException- - if the api service is not found
-
removeApiAuthType
public static void removeApiAuthType(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, @GloopParameter(choices={"BASIC","OAUTH2"},allowNull=false) String authType) throws GloopException
Remove authentication type to the API service within a specific package by providing thepackageNameAuthentication types:NONE
BASIC
OAUTH2
Note: It will remove all the authentication type if the
authTypeisNONE- Parameters:
packageName- - specify the package namenamespace- - the namespace of the api serviceauthType- - the authentication types to be added- Throws:
GloopException- - if the api service is not found
-
removeApiAuthTypes
public static void removeApiAuthTypes(@GloopParameter(allowNull=false) String namespace, @GloopParameter(choices={"BASIC","OAUTH2"},allowNull=false) List<String> authTypes) throws GloopException
Remove authentication types to the API service within the current package Authentication types:NONE
BASIC
OAUTH2
Note: It will remove all the authentication type if the
authTypeisNONE- Parameters:
namespace- - the namespace of the api serviceauthTypes- - the authentication types to be added- Throws:
GloopException- - if the api service is not found
-
removeApiAuthTypes
public static void removeApiAuthTypes(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String namespace, @GloopParameter(choices={"BASIC","OAUTH2"},allowNull=false) List<String> authTypes) throws GloopException
Remove authentication types to the API service within a specific package by providing thepackageNameAuthentication types:NONE
BASIC
OAUTH2
Note: It will remove all the authentication type if the
authTypeisNONE- Parameters:
packageName- - specify the package namenamespace- - the namespace of the api serviceauthTypes- - the authentication types to be added- Throws:
GloopException- - if the api service is not found
-
-