Search in sources :

Example 1 with DisableCheckPermissions

use of com.sequenceiq.authorization.annotation.DisableCheckPermissions in project cloudbreak by hortonworks.

the class UtilV4Controller method deployment.

@Override
@DisableCheckPermissions
public DeploymentPreferencesV4Response deployment() {
    DeploymentPreferencesV4Response response = new DeploymentPreferencesV4Response();
    response.setFeatureSwitchV4s(preferencesService.getFeatureSwitches());
    Set<SupportedExternalDatabaseServiceEntryV4Response> supportedExternalDatabases = SupportedDatabaseProvider.supportedExternalDatabases().stream().map(s -> supportedExternalDatabaseServiceEntryResponseConverter.convert(s)).collect(Collectors.toSet());
    response.setSupportedExternalDatabases(supportedExternalDatabases);
    response.setPlatformSelectionDisabled(preferencesService.isPlatformSelectionDisabled());
    response.setPlatformEnablement(preferencesService.platformEnablement());
    response.setGovPlatformEnablement(preferencesService.govPlatformEnablement());
    return response;
}
Also used : InternalOnly(com.sequenceiq.authorization.annotation.InternalOnly) DeploymentPreferencesV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.DeploymentPreferencesV4Response) NotificationSender(com.sequenceiq.cloudbreak.notification.NotificationSender) SupportedDatabaseProvider(com.sequenceiq.cloudbreak.validation.externaldatabase.SupportedDatabaseProvider) RepoConfigValidationV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.util.requests.RepoConfigValidationV4Request) Controller(org.springframework.stereotype.Controller) RepoConfigValidationV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.RepoConfigValidationV4Response) SupportedExternalDatabaseServiceEntryToSupportedExternalDatabaseServiceEntryResponseConverter(com.sequenceiq.cloudbreak.converter.SupportedExternalDatabaseServiceEntryToSupportedExternalDatabaseServiceEntryResponseConverter) RenewCertificateV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.util.requests.RenewCertificateV4Request) Inject(javax.inject.Inject) Value(org.springframework.beans.factory.annotation.Value) CloudbreakRestRequestThreadLocalService(com.sequenceiq.cloudbreak.structuredevent.CloudbreakRestRequestThreadLocalService) CloudStorageSupportedV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.CloudStorageSupportedV4Responses) ResourceEventResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.ResourceEventResponse) UsedImagesListV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.UsedImagesListV4Response) SupportedExternalDatabaseServiceEntryV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.SupportedExternalDatabaseServiceEntryV4Response) StackMatrixService(com.sequenceiq.cloudbreak.service.StackMatrixService) RepositoryConfigValidationService(com.sequenceiq.cloudbreak.service.cluster.RepositoryConfigValidationService) CloudbreakUser(com.sequenceiq.cloudbreak.common.user.CloudbreakUser) ClientVersionUtil(com.sequenceiq.common.api.util.versionchecker.ClientVersionUtil) PlatformStringTransformer(com.sequenceiq.cloudbreak.service.image.PlatformStringTransformer) StackOperationService(com.sequenceiq.cloudbreak.service.stack.flow.StackOperationService) DisableCheckPermissions(com.sequenceiq.authorization.annotation.DisableCheckPermissions) ResourceEvent(com.sequenceiq.cloudbreak.event.ResourceEvent) Set(java.util.Set) StackMatrixV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.StackMatrixV4Response) CheckPermissionByAccount(com.sequenceiq.authorization.annotation.CheckPermissionByAccount) VersionCheckResult(com.sequenceiq.common.api.util.versionchecker.VersionCheckResult) Collectors(java.util.stream.Collectors) UtilV4Endpoint(com.sequenceiq.cloudbreak.api.endpoint.v4.util.UtilV4Endpoint) Response(javax.ws.rs.core.Response) SecurityRulesV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.SecurityRulesV4Response) UsedImagesProvider(com.sequenceiq.cloudbreak.service.image.UsedImagesProvider) PreferencesService(com.sequenceiq.cloudbreak.service.account.PreferencesService) SecurityRuleService(com.sequenceiq.cloudbreak.service.securityrule.SecurityRuleService) FileSystemSupportMatrixService(com.sequenceiq.cloudbreak.service.filesystem.FileSystemSupportMatrixService) AuthorizationResourceAction(com.sequenceiq.authorization.resource.AuthorizationResourceAction) AccountIdNotNeeded(com.sequenceiq.authorization.annotation.AccountIdNotNeeded) SupportedExternalDatabaseServiceEntryV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.SupportedExternalDatabaseServiceEntryV4Response) DeploymentPreferencesV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.DeploymentPreferencesV4Response) DisableCheckPermissions(com.sequenceiq.authorization.annotation.DisableCheckPermissions)

Example 2 with DisableCheckPermissions

use of com.sequenceiq.authorization.annotation.DisableCheckPermissions in project cloudbreak by hortonworks.

the class CredentialPlatformResourceController method getTagSpecifications.

@Override
@DisableCheckPermissions
public TagSpecificationsResponse getTagSpecifications() {
    LOGGER.info("Get /platform_resources/tag_specifications");
    Map<Platform, PlatformParameters> platformParameters = platformParameterService.getPlatformParameters();
    TagSpecificationsResponse response = tagSpecificationsToTagSpecificationsV1ResponseConverter.convert(platformParameters);
    LOGGER.info("Resp /platform_resources/tag_specifications, platformParameters: {}, response: {}", platformParameters, response);
    return response;
}
Also used : TagSpecificationsResponse(com.sequenceiq.environment.api.v1.platformresource.model.TagSpecificationsResponse) Platform(com.sequenceiq.cloudbreak.cloud.model.Platform) PlatformParameters(com.sequenceiq.cloudbreak.cloud.PlatformParameters) DisableCheckPermissions(com.sequenceiq.authorization.annotation.DisableCheckPermissions)

Example 3 with DisableCheckPermissions

use of com.sequenceiq.authorization.annotation.DisableCheckPermissions in project cloudbreak by hortonworks.

the class CredentialPlatformResourceController method getDisktypes.

@Override
@DisableCheckPermissions
public PlatformDisksResponse getDisktypes() {
    LOGGER.info("Get /platform_resources/disk_types");
    PlatformDisks disks = platformParameterService.getDiskTypes();
    PlatformDisksResponse response = platformDisksToPlatformDisksV1ResponseConverter.convert(disks);
    LOGGER.info("Resp /platform_resources/disk_types, disks: {}, response: {}", disks, response);
    return response;
}
Also used : PlatformDisksResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformDisksResponse) PlatformDisks(com.sequenceiq.cloudbreak.cloud.model.PlatformDisks) DisableCheckPermissions(com.sequenceiq.authorization.annotation.DisableCheckPermissions)

Example 4 with DisableCheckPermissions

use of com.sequenceiq.authorization.annotation.DisableCheckPermissions in project cloudbreak by hortonworks.

the class ImageCatalogV4Controller method getImageByImageId.

@Override
@DisableCheckPermissions
public ImagesV4Response getImageByImageId(Long workspaceId, String imageId, @AccountId String accountId) throws Exception {
    StatedImage statedImage = imageCatalogService.getImageByCatalogName(restRequestThreadLocalService.getRequestedWorkspaceId(), imageId, "");
    Images images = new Images(List.of(), List.of(statedImage.getImage()), List.of(), Set.of());
    return imagesToImagesV4ResponseConverter.convert(images);
}
Also used : Images(com.sequenceiq.cloudbreak.cloud.model.catalog.Images) StatedImage(com.sequenceiq.cloudbreak.service.image.StatedImage) DisableCheckPermissions(com.sequenceiq.authorization.annotation.DisableCheckPermissions)

Aggregations

DisableCheckPermissions (com.sequenceiq.authorization.annotation.DisableCheckPermissions)4 AccountIdNotNeeded (com.sequenceiq.authorization.annotation.AccountIdNotNeeded)1 CheckPermissionByAccount (com.sequenceiq.authorization.annotation.CheckPermissionByAccount)1 InternalOnly (com.sequenceiq.authorization.annotation.InternalOnly)1 AuthorizationResourceAction (com.sequenceiq.authorization.resource.AuthorizationResourceAction)1 UtilV4Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v4.util.UtilV4Endpoint)1 RenewCertificateV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.util.requests.RenewCertificateV4Request)1 RepoConfigValidationV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.util.requests.RepoConfigValidationV4Request)1 CloudStorageSupportedV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.CloudStorageSupportedV4Responses)1 DeploymentPreferencesV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.DeploymentPreferencesV4Response)1 RepoConfigValidationV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.RepoConfigValidationV4Response)1 ResourceEventResponse (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.ResourceEventResponse)1 SecurityRulesV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.SecurityRulesV4Response)1 StackMatrixV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.StackMatrixV4Response)1 SupportedExternalDatabaseServiceEntryV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.SupportedExternalDatabaseServiceEntryV4Response)1 UsedImagesListV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.UsedImagesListV4Response)1 PlatformParameters (com.sequenceiq.cloudbreak.cloud.PlatformParameters)1 Platform (com.sequenceiq.cloudbreak.cloud.model.Platform)1 PlatformDisks (com.sequenceiq.cloudbreak.cloud.model.PlatformDisks)1 Images (com.sequenceiq.cloudbreak.cloud.model.catalog.Images)1