Class LicenseKeyController
- java.lang.Object
-
- io.mosip.kernel.lkeymanager.controller.LicenseKeyController
-
@RestController public class LicenseKeyController extends Object
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 Constructor Description LicenseKeyController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseWrapper<LicenseKeyFetchResponseDto>fetchLicenseKeyPermissions(String tspId, String licenseKey)This method will fetch the mapped permissions for a license key.ResponseWrapper<LicenseKeyGenerationResponseDto>generateLicenseKey(RequestWrapper<LicenseKeyGenerationDto> licenseKeyGenerationDto)This method will generate license key against a certain TSP ID.ResponseWrapper<LicenseKeyMappingResponseDto>mapLicenseKey(RequestWrapper<LicenseKeyMappingDto> licenseKeyMappingDto)This method will map license key to several permissions.
-
-
-
Method Detail
-
generateLicenseKey
@ResponseFilter @PostMapping("/license/generate") public ResponseWrapper<LicenseKeyGenerationResponseDto> generateLicenseKey(@RequestBody 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 ResponseWrapper<LicenseKeyMappingResponseDto> mapLicenseKey(@RequestBody 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 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.
-
-