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 String
API_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 void
addApiAuthType(String namespace, String authType)
Add authentication type to the API service within current package Authentication types:static void
addApiAuthType(String packageName, String namespace, String authType)
Add authentication type to the API service within a specific package by providing thepackageName
Authentication types:static void
addApiAuthTypes(String packageName, String namespace, List<String> authTypes)
Add authentication types to the API service within a specific package by providing thepackageName
Authentication types:static void
addApiAuthTypes(String namespace, List<String> authTypes)
Add authentication types to the API service within the current package Authentication types:static void
addApiGroup(String namespace, String groupName)
Add groupName authentication to the API service within current packagestatic void
addApiGroup(String packageName, String namespace, String groupName)
Add groupName authentication to the API service within a specific package by providing thepackageName
static void
addApiGroups(String packageName, String namespace, Set<String> groupNames)
Add groupNames authentication to the API service within a specific package by providing thepackageName
static void
addApiGroups(String namespace, Set<String> groupNames)
Add groupNames authentication to the API service within the current packagestatic void
addApiUser(String namespace, String username)
Add username to the API service within the current packagestatic void
addApiUser(String packageName, String namespace, String username)
Add username authentication to the API service within a specific package by providing thepackageName
.static void
addApiUsers(String packageName, String namespace, Set<String> usernames)
Add usernames authentication to the API service within a specific package by providing thepackageName
static void
addApiUsers(String namespace, Set<String> usernames)
Add usernames authentication to the API service within a specific package.static void
removeApiAuthType(String namespace, String authType)
Remove authentication type to the API service within the current package Authentication types:static void
removeApiAuthType(String packageName, String namespace, String authType)
Remove authentication type to the API service within a specific package by providing thepackageName
Authentication types:static void
removeApiAuthTypes(String packageName, String namespace, List<String> authTypes)
Remove authentication types to the API service within a specific package by providing thepackageName
Authentication types:static void
removeApiAuthTypes(String namespace, List<String> authTypes)
Remove authentication types to the API service within the current package Authentication types:static void
removeApiGroup(String namespace, String groupName)
Remove groupName authentication to the API service within current packagestatic void
removeApiGroup(String packageName, String namespace, String groupName)
Remove groupName authentication to the API service within a specify package by providing thepackageName
static void
removeApiGroups(String packageName, String namespace, List<String> groupNames)
Remove groupNames authentication to the API service within a specify package by providing thepackageName
static void
removeApiGroups(String namespace, List<String> groupNames)
Remove groupNames authentication to the API service within the current packagestatic void
removeApiUser(String namespace, String username)
Remove username authentication to the API service within the current packagestatic void
removeApiUser(String packageName, String namespace, String username)
Remove username authentication to the API service within a specific package by providing thepackageName
.static void
removeApiUsers(String packageName, String namespace, List<String> usernames)
Remove usernames authentication to the API service within a specific package by providing thepackageName
.static void
removeApiUsers(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
NONE
as 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 thepackageName
Authentication types:NONE
BASIC
OAUTH2
Note: Adding
NONE
as 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
NONE
authentication 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 thepackageName
Authentication types:NONE
BASIC
OAUTH2
Note: Adding
NONE
authentication 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
authType
isNONE
- 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 thepackageName
Authentication types:NONE
BASIC
OAUTH2
Note: It will remove all the authentication type if the
authType
isNONE
- 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
authType
isNONE
- 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 thepackageName
Authentication types:NONE
BASIC
OAUTH2
Note: It will remove all the authentication type if the
authType
isNONE
- 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
-
-