Skip to content

Commit

Permalink
Add Tenant Policy service
Browse files Browse the repository at this point in the history
  • Loading branch information
sidpan1 committed Apr 11, 2024
1 parent 1b5fa60 commit 465e46b
Show file tree
Hide file tree
Showing 86 changed files with 8,706 additions and 40 deletions.
72 changes: 72 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ docs/CreateUserTenantMappingResponse.md
docs/DeactivatePolicyTemplateRequest.md
docs/DefaultApi.md
docs/DeprecatePolicyTemplateRequest.md
docs/DisableTenantPolicyRequest.md
docs/DisableTenantRequest.md
docs/EnableAllPoliciesRequest.md
docs/EnableTenantPolicyRequest.md
docs/GcpService.md
docs/GetAllUsersRequest.md
docs/GetAllUsersResponse.md
Expand All @@ -37,6 +40,12 @@ docs/GetPolicyTemplatesRequest.md
docs/GetPolicyTemplatesResponse.md
docs/GetTenantByIDRequest.md
docs/GetTenantByIDResponse.md
docs/GetTenantPoliciesAPIRequest.md
docs/GetTenantPoliciesRequest.md
docs/GetTenantPoliciesResponse.md
docs/GetTenantPolicySettingsAPIRequest.md
docs/GetTenantPolicySettingsRequest.md
docs/GetTenantPolicySettingsResponse.md
docs/GetTenantProviderByIDRequest.md
docs/GetTenantProviderByIDResponse.md
docs/GetTenantProvidersRequest.md
Expand All @@ -45,6 +54,9 @@ docs/GetTenantsRequest.md
docs/GetTenantsResponse.md
docs/GetUserByIDResponse.md
docs/HTTPValidationError.md
docs/OverrideTenantPolicyConfigAPIRequest.md
docs/OverrideTenantPolicyConfigRequest.md
docs/OverrideTenantPolicyConfigResponse.md
docs/PaginationFields.md
docs/PaginationParams.md
docs/PoliciesPolicyTemplatePacksApi.md
Expand All @@ -68,13 +80,18 @@ docs/ResponseCreatePolicyTemplateResponse.md
docs/ResponseCreateTenantUserResponse.md
docs/ResponseCreateUserTenantMappingResponse.md
docs/ResponseDeprecatePolicyTemplateResponse.md
docs/ResponseDisableTenantPolicyResponse.md
docs/ResponseDisableTenantProviderResponse.md
docs/ResponseDisableTenantResponse.md
docs/ResponseEnableAllPoliciesResponse.md
docs/ResponseEnableTenantPolicyResponse.md
docs/ResponseGetPolicyTemplateByIDResponse.md
docs/ResponseGetPolicyTemplatePackByIdResponse.md
docs/ResponseGetPolicyTemplatePacksResponse.md
docs/ResponseGetPolicyTemplatesResponse.md
docs/ResponseGetTenantByIDResponse.md
docs/ResponseGetTenantPoliciesResponse.md
docs/ResponseGetTenantPolicySettingsResponse.md
docs/ResponseGetTenantProviderByIDResponse.md
docs/ResponseGetTenantProvidersResponse.md
docs/ResponseGetTenantsResponse.md
Expand All @@ -86,6 +103,13 @@ docs/ResponseUpdateTenantUserResponse.md
docs/RuleType.md
docs/Tenant.md
docs/TenantFilters.md
docs/TenantPoliciesApi.md
docs/TenantPolicy.md
docs/TenantPolicyFilters.md
docs/TenantPolicyServiceApi.md
docs/TenantPolicySettings.md
docs/TenantPolicySettingsFilters.md
docs/TenantPolicyState.md
docs/TenantProvider.md
docs/TenantProviderAttributes.md
docs/TenantProviderFilters.md
Expand Down Expand Up @@ -123,6 +147,8 @@ onelens_backend_client/api/policies_policy_template_packs_api.py
onelens_backend_client/api/policies_policy_templates_api.py
onelens_backend_client/api/policy_template_pack_service_api.py
onelens_backend_client/api/policy_template_service_api.py
onelens_backend_client/api/tenant_policies_api.py
onelens_backend_client/api/tenant_policy_service_api.py
onelens_backend_client/api/tenant_provider_service_api.py
onelens_backend_client/api/tenant_service_api.py
onelens_backend_client/api/tenant_users_api.py
Expand Down Expand Up @@ -155,7 +181,10 @@ onelens_backend_client/models/create_user_tenant_mapping_request.py
onelens_backend_client/models/create_user_tenant_mapping_response.py
onelens_backend_client/models/deactivate_policy_template_request.py
onelens_backend_client/models/deprecate_policy_template_request.py
onelens_backend_client/models/disable_tenant_policy_request.py
onelens_backend_client/models/disable_tenant_request.py
onelens_backend_client/models/enable_all_policies_request.py
onelens_backend_client/models/enable_tenant_policy_request.py
onelens_backend_client/models/gcp_service.py
onelens_backend_client/models/get_all_users_request.py
onelens_backend_client/models/get_all_users_response.py
Expand All @@ -169,6 +198,12 @@ onelens_backend_client/models/get_policy_templates_request.py
onelens_backend_client/models/get_policy_templates_response.py
onelens_backend_client/models/get_tenant_by_id_request.py
onelens_backend_client/models/get_tenant_by_id_response.py
onelens_backend_client/models/get_tenant_policies_api_request.py
onelens_backend_client/models/get_tenant_policies_request.py
onelens_backend_client/models/get_tenant_policies_response.py
onelens_backend_client/models/get_tenant_policy_settings_api_request.py
onelens_backend_client/models/get_tenant_policy_settings_request.py
onelens_backend_client/models/get_tenant_policy_settings_response.py
onelens_backend_client/models/get_tenant_provider_by_id_request.py
onelens_backend_client/models/get_tenant_provider_by_id_response.py
onelens_backend_client/models/get_tenant_providers_request.py
Expand All @@ -177,6 +212,9 @@ onelens_backend_client/models/get_tenants_request.py
onelens_backend_client/models/get_tenants_response.py
onelens_backend_client/models/get_user_by_id_response.py
onelens_backend_client/models/http_validation_error.py
onelens_backend_client/models/override_tenant_policy_config_api_request.py
onelens_backend_client/models/override_tenant_policy_config_request.py
onelens_backend_client/models/override_tenant_policy_config_response.py
onelens_backend_client/models/pagination_fields.py
onelens_backend_client/models/pagination_params.py
onelens_backend_client/models/policy_category.py
Expand All @@ -196,13 +234,18 @@ onelens_backend_client/models/response_create_policy_template_response.py
onelens_backend_client/models/response_create_tenant_user_response.py
onelens_backend_client/models/response_create_user_tenant_mapping_response.py
onelens_backend_client/models/response_deprecate_policy_template_response.py
onelens_backend_client/models/response_disable_tenant_policy_response.py
onelens_backend_client/models/response_disable_tenant_provider_response.py
onelens_backend_client/models/response_disable_tenant_response.py
onelens_backend_client/models/response_enable_all_policies_response.py
onelens_backend_client/models/response_enable_tenant_policy_response.py
onelens_backend_client/models/response_get_policy_template_by_id_response.py
onelens_backend_client/models/response_get_policy_template_pack_by_id_response.py
onelens_backend_client/models/response_get_policy_template_packs_response.py
onelens_backend_client/models/response_get_policy_templates_response.py
onelens_backend_client/models/response_get_tenant_by_id_response.py
onelens_backend_client/models/response_get_tenant_policies_response.py
onelens_backend_client/models/response_get_tenant_policy_settings_response.py
onelens_backend_client/models/response_get_tenant_provider_by_id_response.py
onelens_backend_client/models/response_get_tenant_providers_response.py
onelens_backend_client/models/response_get_tenants_response.py
Expand All @@ -214,6 +257,11 @@ onelens_backend_client/models/response_update_tenant_user_response.py
onelens_backend_client/models/rule_type.py
onelens_backend_client/models/tenant.py
onelens_backend_client/models/tenant_filters.py
onelens_backend_client/models/tenant_policy.py
onelens_backend_client/models/tenant_policy_filters.py
onelens_backend_client/models/tenant_policy_settings.py
onelens_backend_client/models/tenant_policy_settings_filters.py
onelens_backend_client/models/tenant_policy_state.py
onelens_backend_client/models/tenant_provider.py
onelens_backend_client/models/tenant_provider_attributes.py
onelens_backend_client/models/tenant_provider_filters.py
Expand Down Expand Up @@ -243,4 +291,28 @@ setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_disable_tenant_policy_request.py
test/test_enable_all_policies_request.py
test/test_enable_tenant_policy_request.py
test/test_get_tenant_policies_api_request.py
test/test_get_tenant_policies_request.py
test/test_get_tenant_policies_response.py
test/test_get_tenant_policy_settings_api_request.py
test/test_get_tenant_policy_settings_request.py
test/test_get_tenant_policy_settings_response.py
test/test_override_tenant_policy_config_api_request.py
test/test_override_tenant_policy_config_request.py
test/test_override_tenant_policy_config_response.py
test/test_response_disable_tenant_policy_response.py
test/test_response_enable_all_policies_response.py
test/test_response_enable_tenant_policy_response.py
test/test_response_get_tenant_policies_response.py
test/test_response_get_tenant_policy_settings_response.py
test/test_tenant_policies_api.py
test/test_tenant_policy.py
test/test_tenant_policy_filters.py
test/test_tenant_policy_service_api.py
test/test_tenant_policy_settings.py
test/test_tenant_policy_settings_filters.py
test/test_tenant_policy_state.py
tox.ini
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ Class | Method | Description
*PolicyTemplateServiceApi* | [**get_policy_template_by_id**](docs/PolicyTemplateServiceApi.md#get_policy_template_by_id) | Retrieves a policy template by its unique identifier.
*PolicyTemplateServiceApi* | [**get_policy_templates**](docs/PolicyTemplateServiceApi.md#get_policy_templates) | Retrieves all policy templates, optionally filtered by the parameters in the request.
*PolicyTemplateServiceApi* | [**update_policy_template**](docs/PolicyTemplateServiceApi.md#update_policy_template) | Updates an existing policy template.
*TenantPoliciesApi* | [**disable_tenant_policy**](docs/TenantPoliciesApi.md#disable_tenant_policy) | Disable Tenant Policy
*TenantPoliciesApi* | [**enable_all_policies**](docs/TenantPoliciesApi.md#enable_all_policies) | Enable All Policies
*TenantPoliciesApi* | [**enable_tenant_policy**](docs/TenantPoliciesApi.md#enable_tenant_policy) | Enable Tenant Policy
*TenantPoliciesApi* | [**get_tenant_policies**](docs/TenantPoliciesApi.md#get_tenant_policies) | Get Tenant Policies
*TenantPoliciesApi* | [**get_tenant_policy_settings**](docs/TenantPoliciesApi.md#get_tenant_policy_settings) | Get Tenant Policy Settings
*TenantPoliciesApi* | [**override_tenant_policy_config**](docs/TenantPoliciesApi.md#override_tenant_policy_config) | Override Tenant Policy Config
*TenantPolicyServiceApi* | [**disable_tenant_policy**](docs/TenantPolicyServiceApi.md#disable_tenant_policy) | disable a policy for a tenant in the tenant DB.
*TenantPolicyServiceApi* | [**enable_all_policies**](docs/TenantPolicyServiceApi.md#enable_all_policies) | enables all policies for a tenant.
*TenantPolicyServiceApi* | [**enable_tenant_policy**](docs/TenantPolicyServiceApi.md#enable_tenant_policy) | enables a policy for a tenant in the tenant DB.
*TenantPolicyServiceApi* | [**get_tenant_policies**](docs/TenantPolicyServiceApi.md#get_tenant_policies) | Retrieves all tenant policies, optionally filtered by the parameters in the request.
*TenantPolicyServiceApi* | [**get_tenant_policy_settings**](docs/TenantPolicyServiceApi.md#get_tenant_policy_settings) | Retrieves all tenant policy settings, optionally filtered by the parameters in the request.
*TenantPolicyServiceApi* | [**override_tenant_policy_config**](docs/TenantPolicyServiceApi.md#override_tenant_policy_config) | Override the tenant policy config with the provided config.
*TenantProviderServiceApi* | [**create_tenant_provider**](docs/TenantProviderServiceApi.md#create_tenant_provider) | Creates a new tenant Provider.
*TenantProviderServiceApi* | [**get_tenant_provider_by_id**](docs/TenantProviderServiceApi.md#get_tenant_provider_by_id) | Retrieves a Tenant Provider by its unique identifier.
*TenantProviderServiceApi* | [**get_tenant_providers**](docs/TenantProviderServiceApi.md#get_tenant_providers) | Retrieves all tenant providers.
Expand Down Expand Up @@ -154,7 +166,10 @@ Class | Method | Description
- [CreateUserTenantMappingResponse](docs/CreateUserTenantMappingResponse.md)
- [DeactivatePolicyTemplateRequest](docs/DeactivatePolicyTemplateRequest.md)
- [DeprecatePolicyTemplateRequest](docs/DeprecatePolicyTemplateRequest.md)
- [DisableTenantPolicyRequest](docs/DisableTenantPolicyRequest.md)
- [DisableTenantRequest](docs/DisableTenantRequest.md)
- [EnableAllPoliciesRequest](docs/EnableAllPoliciesRequest.md)
- [EnableTenantPolicyRequest](docs/EnableTenantPolicyRequest.md)
- [GcpService](docs/GcpService.md)
- [GetAllUsersRequest](docs/GetAllUsersRequest.md)
- [GetAllUsersResponse](docs/GetAllUsersResponse.md)
Expand All @@ -168,6 +183,12 @@ Class | Method | Description
- [GetPolicyTemplatesResponse](docs/GetPolicyTemplatesResponse.md)
- [GetTenantByIDRequest](docs/GetTenantByIDRequest.md)
- [GetTenantByIDResponse](docs/GetTenantByIDResponse.md)
- [GetTenantPoliciesAPIRequest](docs/GetTenantPoliciesAPIRequest.md)
- [GetTenantPoliciesRequest](docs/GetTenantPoliciesRequest.md)
- [GetTenantPoliciesResponse](docs/GetTenantPoliciesResponse.md)
- [GetTenantPolicySettingsAPIRequest](docs/GetTenantPolicySettingsAPIRequest.md)
- [GetTenantPolicySettingsRequest](docs/GetTenantPolicySettingsRequest.md)
- [GetTenantPolicySettingsResponse](docs/GetTenantPolicySettingsResponse.md)
- [GetTenantProviderByIDRequest](docs/GetTenantProviderByIDRequest.md)
- [GetTenantProviderByIDResponse](docs/GetTenantProviderByIDResponse.md)
- [GetTenantProvidersRequest](docs/GetTenantProvidersRequest.md)
Expand All @@ -176,6 +197,9 @@ Class | Method | Description
- [GetTenantsResponse](docs/GetTenantsResponse.md)
- [GetUserByIDResponse](docs/GetUserByIDResponse.md)
- [HTTPValidationError](docs/HTTPValidationError.md)
- [OverrideTenantPolicyConfigAPIRequest](docs/OverrideTenantPolicyConfigAPIRequest.md)
- [OverrideTenantPolicyConfigRequest](docs/OverrideTenantPolicyConfigRequest.md)
- [OverrideTenantPolicyConfigResponse](docs/OverrideTenantPolicyConfigResponse.md)
- [PaginationFields](docs/PaginationFields.md)
- [PaginationParams](docs/PaginationParams.md)
- [PolicyCategory](docs/PolicyCategory.md)
Expand All @@ -195,13 +219,18 @@ Class | Method | Description
- [ResponseCreateTenantUserResponse](docs/ResponseCreateTenantUserResponse.md)
- [ResponseCreateUserTenantMappingResponse](docs/ResponseCreateUserTenantMappingResponse.md)
- [ResponseDeprecatePolicyTemplateResponse](docs/ResponseDeprecatePolicyTemplateResponse.md)
- [ResponseDisableTenantPolicyResponse](docs/ResponseDisableTenantPolicyResponse.md)
- [ResponseDisableTenantProviderResponse](docs/ResponseDisableTenantProviderResponse.md)
- [ResponseDisableTenantResponse](docs/ResponseDisableTenantResponse.md)
- [ResponseEnableAllPoliciesResponse](docs/ResponseEnableAllPoliciesResponse.md)
- [ResponseEnableTenantPolicyResponse](docs/ResponseEnableTenantPolicyResponse.md)
- [ResponseGetPolicyTemplateByIDResponse](docs/ResponseGetPolicyTemplateByIDResponse.md)
- [ResponseGetPolicyTemplatePackByIdResponse](docs/ResponseGetPolicyTemplatePackByIdResponse.md)
- [ResponseGetPolicyTemplatePacksResponse](docs/ResponseGetPolicyTemplatePacksResponse.md)
- [ResponseGetPolicyTemplatesResponse](docs/ResponseGetPolicyTemplatesResponse.md)
- [ResponseGetTenantByIDResponse](docs/ResponseGetTenantByIDResponse.md)
- [ResponseGetTenantPoliciesResponse](docs/ResponseGetTenantPoliciesResponse.md)
- [ResponseGetTenantPolicySettingsResponse](docs/ResponseGetTenantPolicySettingsResponse.md)
- [ResponseGetTenantProviderByIDResponse](docs/ResponseGetTenantProviderByIDResponse.md)
- [ResponseGetTenantProvidersResponse](docs/ResponseGetTenantProvidersResponse.md)
- [ResponseGetTenantsResponse](docs/ResponseGetTenantsResponse.md)
Expand All @@ -213,6 +242,11 @@ Class | Method | Description
- [RuleType](docs/RuleType.md)
- [Tenant](docs/Tenant.md)
- [TenantFilters](docs/TenantFilters.md)
- [TenantPolicy](docs/TenantPolicy.md)
- [TenantPolicyFilters](docs/TenantPolicyFilters.md)
- [TenantPolicySettings](docs/TenantPolicySettings.md)
- [TenantPolicySettingsFilters](docs/TenantPolicySettingsFilters.md)
- [TenantPolicyState](docs/TenantPolicyState.md)
- [TenantProvider](docs/TenantProvider.md)
- [TenantProviderAttributes](docs/TenantProviderAttributes.md)
- [TenantProviderFilters](docs/TenantProviderFilters.md)
Expand Down
19 changes: 11 additions & 8 deletions REGENERATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
Run this to regenerate the client code.

```
docker run --rm -v "${PWD}:/onelens-backend-python-client" openapitools/openapi-generator-cli:local-fix generate \ -i http://host.docker.internal:19000/openapi.json \
-g python \
-o /onelens-backend-python-client/ \
-t /onelens-backend-python-client/templates/ \
-c /onelens-backend-python-client/config.yaml \
-p packageName=onelens_backend_client \
-p projectName=onelens-backend-python-client \
--skip-validate-spec
docker run --rm -v "${PWD}:/onelens-backend-python-client" openapitools/openapi-generator-cli:local-fix generate \
-i http://host.docker.internal:19000/openapi.json \
-g python \
-o /onelens-backend-python-client/ \
-t /onelens-backend-python-client/templates/ \
-c /onelens-backend-python-client/config.yaml \
-p packageName=onelens_backend_client \
-p projectName=onelens-backend-python-client \
--skip-validate-spec
```
4 changes: 2 additions & 2 deletions docs/CreatePolicyTemplateResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Name | Type | Description | Notes
**services** | [**List[CreatePolicyTemplateRequestServicesInner]**](CreatePolicyTemplateRequestServicesInner.md) | The list of services associated the policy template. |
**execution_type** | [**PolicyExecutionType**](PolicyExecutionType.md) | The execution type of the policy template. |
**details** | [**PolicyTemplateDetails**](PolicyTemplateDetails.md) | The details of the policy template. |
**id** | **str** | The unique identifier of the policy template. |
**state** | [**PolicyTemplateState**](PolicyTemplateState.md) | The state of the policy template. |
**category** | [**PolicyCategory**](PolicyCategory.md) | The category of the policy template. |
**provider** | [**Provider**](Provider.md) | The cloud provider of the policy template. |
**id** | **str** | The unique identifier of the policy template. |
**state** | [**PolicyTemplateState**](PolicyTemplateState.md) | The state of the policy template. |

## Example

Expand Down
30 changes: 30 additions & 0 deletions docs/DisableTenantPolicyRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# DisableTenantPolicyRequest


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tenant_id** | **str** | The id of the tenant. |
**policy_id** | **str** | The id of the tenant policy. |

## Example

```python
from onelens_backend_client.models.disable_tenant_policy_request import DisableTenantPolicyRequest

# TODO update the JSON string below
json = "{}"
# create an instance of DisableTenantPolicyRequest from a JSON string
disable_tenant_policy_request_instance = DisableTenantPolicyRequest.from_json(json)
# print the JSON string representation of the object
print(DisableTenantPolicyRequest.to_json())

# convert the object into a dict
disable_tenant_policy_request_dict = disable_tenant_policy_request_instance.to_dict()
# create an instance of DisableTenantPolicyRequest from a dict
disable_tenant_policy_request_form_dict = disable_tenant_policy_request.from_dict(disable_tenant_policy_request_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


29 changes: 29 additions & 0 deletions docs/EnableAllPoliciesRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# EnableAllPoliciesRequest


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tenant_id** | **str** | The id of the tenant. |

## Example

```python
from onelens_backend_client.models.enable_all_policies_request import EnableAllPoliciesRequest

# TODO update the JSON string below
json = "{}"
# create an instance of EnableAllPoliciesRequest from a JSON string
enable_all_policies_request_instance = EnableAllPoliciesRequest.from_json(json)
# print the JSON string representation of the object
print(EnableAllPoliciesRequest.to_json())

# convert the object into a dict
enable_all_policies_request_dict = enable_all_policies_request_instance.to_dict()
# create an instance of EnableAllPoliciesRequest from a dict
enable_all_policies_request_form_dict = enable_all_policies_request.from_dict(enable_all_policies_request_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading

0 comments on commit 465e46b

Please sign in to comment.