Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Change Log (v2.8.1+)

## v4.2.0 [2025-05-30]

__What's New:__

* Added `advanced_settings` functionality to:
* `application_management`
* `application_management.profiles`
* `access_broker.profiles`
* Added `global_settings.itsm` functionality.

__Enhancements:__

* Added missing params for `secrets_manager.[secrets|vaults]` and `file` updates.

__Bug Fixes:__

* None

__Dependencies:__

* None

__Other:__

* Updated tests to use uniform naming convention.
* Refactored `application_management.profiles` to break out classes for added clarity.

## v4.1.3 [2025-03-07]

__What's New:__
Expand Down
2 changes: 1 addition & 1 deletion src/britive/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.1.3'
__version__ = '4.2.0'
3 changes: 3 additions & 0 deletions src/britive/access_broker/profiles/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from britive.application_management.advanced_settings import AdvancedSettings

from .permissions import Permissions
from .policies import Policies

Expand All @@ -6,6 +8,7 @@ class Profiles:
def __init__(self, britive) -> None:
self.britive = britive
self.base_url = f'{self.britive.base_url}/resource-manager/profiles'
self.advanced_settings = AdvancedSettings(britive, base_url='/resource-manager/profile/{}/advanced-settings')
self.permissions = Permissions(britive)
self.policies = Policies(britive)

Expand Down
16 changes: 8 additions & 8 deletions src/britive/access_broker/profiles/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ def create(
:param condition: Condition of the policy.
:param members: Dict of member type objects.
Example: {
users: [
'users': [
{'id': '...'}
],
tags: [
'tags': [
{'id': '...'}
],
tokens: [
'tokens': [
{'id': '...'}
],
serviceIdentities: [
'serviceIdentities': [
{'id': '...'}
],
}
Expand Down Expand Up @@ -111,16 +111,16 @@ def update(
:param condition: Condition of the policy.
:param members: Dict of member type objects.
Example: {
users: [
'users': [
{'id': '...'}
],
tags: [
'tags': [
{'id': '...'}
],
tokens: [
'tokens': [
{'id': '...'}
],
serviceIdentities: [
'serviceIdentities': [
{'id': '...'}
],
}
Expand Down
2 changes: 2 additions & 0 deletions src/britive/application_management/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .access_builder import AccessBuilderSettings
from .accounts import Accounts
from .advanced_settings import AdvancedSettings
from .applications import Applications
from .environment_groups import EnvironmentGroups
from .environments import Environments
Expand All @@ -14,6 +15,7 @@ class ApplicationManagement:
def __init__(self, britive) -> None:
self.access_builder = AccessBuilderSettings(britive)
self.accounts = Accounts(britive)
self.advanced_settings = AdvancedSettings(britive)
self.applications = Applications(britive)
self.environment_groups = EnvironmentGroups(britive)
self.environments = Environments(britive)
Expand Down
47 changes: 47 additions & 0 deletions src/britive/application_management/advanced_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
class AdvancedSettings:
def __init__(self, britive, base_url: str = '/apps/{}/advanced-settings') -> None:
self.britive = britive
self.base_url = self.britive.base_url + base_url

def create(self, entity_id: str, settings: dict) -> dict:
"""
Create Advanced Settings for a specific application or profile.

:param entity_id: The ID of the application or profile to create Advanced Settings for.
:param settings: The Advanced Settings settings.
:return: Details of the created Advanced Settings.
"""

return self.britive.post(self.base_url.format(entity_id), json=settings)

def get(self, entity_id: str) -> dict:
"""
Get Advanced Settings for a specific application or profile.

:param entity_id: The ID of the application or profile to retrieve Advanced Settings for.
:return: Details of the Advanced Settings.
"""

return self.britive.get(self.base_url.format(entity_id))

def update(self, entity_id: str, settings: dict) -> dict:
"""
Update Advanced Settings for a specific application or profile.

:param entity_id: The ID of the application or profile to update Advanced Settings for.
:param settings: The Advanced Settings settings to update.
:return: Details of the updated Advanced Settings.
"""

return self.britive.put(self.base_url.format(entity_id), json=settings)

def delete(self, entity_id: str, settings_id: str) -> None:
"""
Delete Advanced Settings for a specific application or profile.

:param entity_id: The ID of the application or profile associated with the Advanced Settings.
:param settings_id: The ID of the Advanced Settings settings to delete.
:return: None.
"""

self.britive.delete(f'{self.base_url.format(entity_id)}/{settings_id}')
Loading