@Test @WithMockUser(authorities = { "VIEW_KEYS" }) public void getPossibleActionsForKey() throws Exception { EnumSet<PossibleActionEnum> possibleActions = keyService.getPossibleActionsForKey(SIGN_KEY_ID); Set<PossibleActionEnum> allActions = new HashSet(Arrays.asList(PossibleActionEnum.values())); assertEquals(allActions, new HashSet<>(possibleActions)); }
public EnumSet<PossibleActionEnum> getPossibleActionsForKey(String keyId) throws KeyNotFoundException { TokenInfo tokenInfo = tokenService.getTokenForKeyId(keyId); KeyInfo keyInfo = getKey(tokenInfo, keyId); EnumSet<PossibleActionEnum> possibleActions = possibleActionsRuleEngine .getPossibleKeyActions(tokenInfo, keyInfo); return possibleActions; }
KeyService { public EnumSet<PossibleActionEnum> getPossibleActionsForKey(String keyId) throws KeyNotFoundException { TokenInfo tokenInfo = tokenService.getTokenForKeyId(keyId); KeyInfo keyInfo = getKey(tokenInfo, keyId); EnumSet<PossibleActionEnum> possibleActions = possibleActionsRuleEngine .getPossibleKeyActions(tokenInfo, keyInfo); return possibleActions; } }
KeyService { public EnumSet<PossibleActionEnum> getPossibleActionsForKey(String keyId) throws KeyNotFoundException { TokenInfo tokenInfo = tokenService.getTokenForKeyId(keyId); KeyInfo keyInfo = getKey(tokenInfo, keyId); EnumSet<PossibleActionEnum> possibleActions = possibleActionsRuleEngine .getPossibleKeyActions(tokenInfo, keyInfo); return possibleActions; } @Autowired  KeyService(TokenService tokenService, SignerProxyFacade signerProxyFacade,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            ManagementRequestSenderService managementRequestSenderService,
            SecurityHelper securityHelper,
            AuditDataHelper auditDataHelper,
            AuditEventHelper auditEventHelper,
            AuditEventLoggingFacade auditEventLoggingFacade); }
KeyService { public EnumSet<PossibleActionEnum> getPossibleActionsForKey(String keyId) throws KeyNotFoundException { TokenInfo tokenInfo = tokenService.getTokenForKeyId(keyId); KeyInfo keyInfo = getKey(tokenInfo, keyId); EnumSet<PossibleActionEnum> possibleActions = possibleActionsRuleEngine .getPossibleKeyActions(tokenInfo, keyInfo); return possibleActions; } @Autowired  KeyService(TokenService tokenService, SignerProxyFacade signerProxyFacade,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            ManagementRequestSenderService managementRequestSenderService,
            SecurityHelper securityHelper,
            AuditDataHelper auditDataHelper,
            AuditEventHelper auditEventHelper,
            AuditEventLoggingFacade auditEventLoggingFacade); KeyInfo getKey(String keyId); KeyInfo getKey(TokenInfo tokenInfo, String keyId); KeyInfo updateKeyFriendlyName(String id, String friendlyName); KeyInfo addKey(String tokenId, String keyLabel); void deleteKeyAndIgnoreWarnings(String keyId); void deleteKey(String keyId, Boolean ignoreWarnings); EnumSet<PossibleActionEnum> getPossibleActionsForKey(String keyId); }
KeyService { public EnumSet<PossibleActionEnum> getPossibleActionsForKey(String keyId) throws KeyNotFoundException { TokenInfo tokenInfo = tokenService.getTokenForKeyId(keyId); KeyInfo keyInfo = getKey(tokenInfo, keyId); EnumSet<PossibleActionEnum> possibleActions = possibleActionsRuleEngine .getPossibleKeyActions(tokenInfo, keyInfo); return possibleActions; } @Autowired  KeyService(TokenService tokenService, SignerProxyFacade signerProxyFacade,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            ManagementRequestSenderService managementRequestSenderService,
            SecurityHelper securityHelper,
            AuditDataHelper auditDataHelper,
            AuditEventHelper auditEventHelper,
            AuditEventLoggingFacade auditEventLoggingFacade); KeyInfo getKey(String keyId); KeyInfo getKey(TokenInfo tokenInfo, String keyId); KeyInfo updateKeyFriendlyName(String id, String friendlyName); KeyInfo addKey(String tokenId, String keyLabel); void deleteKeyAndIgnoreWarnings(String keyId); void deleteKey(String keyId, Boolean ignoreWarnings); EnumSet<PossibleActionEnum> getPossibleActionsForKey(String keyId); static final String WARNING_AUTH_KEY_REGISTERED_CERT_DETECTED; }