Class LicenseKeyController
java.lang.Object
io.mosip.kernel.lkeymanager.controller.LicenseKeyController
Controller class that provides various methods for license key management
such as to generate license key for a specified TSP ID, mapping several
permissions to a generated license key, fetching the specified permissions
for a license key.
- Since:
- 1.0.0
- Author:
- Sagar Mahapatra
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.mosip.kernel.core.http.ResponseWrapper<LicenseKeyFetchResponseDto> fetchLicenseKeyPermissions(String tspId, String licenseKey) This method will fetch the mapped permissions for a license key.io.mosip.kernel.core.http.ResponseWrapper<LicenseKeyGenerationResponseDto> generateLicenseKey(io.mosip.kernel.core.http.RequestWrapper<LicenseKeyGenerationDto> licenseKeyGenerationDto) This method will generate license key against a certain TSP ID.io.mosip.kernel.core.http.ResponseWrapper<LicenseKeyMappingResponseDto> mapLicenseKey(io.mosip.kernel.core.http.RequestWrapper<LicenseKeyMappingDto> licenseKeyMappingDto) This method will map license key to several permissions.
-
Constructor Details
-
LicenseKeyController
public LicenseKeyController()
-
-
Method Details
-
generateLicenseKey
@PreAuthorize("hasAnyRole(@lkeyAuthRoles.getPostlicensegenerate())") @ResponseFilter @PostMapping("/license/generate") public io.mosip.kernel.core.http.ResponseWrapper<LicenseKeyGenerationResponseDto> generateLicenseKey(@RequestBody io.mosip.kernel.core.http.RequestWrapper<LicenseKeyGenerationDto> licenseKeyGenerationDto) This method will generate license key against a certain TSP ID.- Parameters:
licenseKeyGenerationDto- the LicenseKeyGenerationResponseDto request object wrapped inRequestWrapper.- Returns:
- the response entity.
-
mapLicenseKey
@ResponseFilter @PostMapping("/license/permission") public io.mosip.kernel.core.http.ResponseWrapper<LicenseKeyMappingResponseDto> mapLicenseKey(@RequestBody io.mosip.kernel.core.http.RequestWrapper<LicenseKeyMappingDto> licenseKeyMappingDto) This method will map license key to several permissions. The permissions provided must be present in the master list.- Parameters:
licenseKeyMappingDto- theLicenseKeyMappingDto.- Returns:
- the response entity.
-
fetchLicenseKeyPermissions
@ResponseFilter @GetMapping("/license/permission") public io.mosip.kernel.core.http.ResponseWrapper<LicenseKeyFetchResponseDto> fetchLicenseKeyPermissions(@RequestParam("tspId") String tspId, @RequestParam("licenseKey") String licenseKey) This method will fetch the mapped permissions for a license key.- Parameters:
tspId- tsp idlicenseKey- the license key of which the permissions need to be fetched.- Returns:
- the permissions fetched.
-