Skip to content

Commit 194695c

Browse files
authored
Merge pull request #150 from britive/feature/advanced-settings
feature/advanced-settings
2 parents 2d8b4d3 + a6e463f commit 194695c

31 files changed

Lines changed: 1305 additions & 869 deletions

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Change Log (v2.8.1+)
22

3+
## v4.2.0 [2025-05-30]
4+
5+
__What's New:__
6+
7+
* Added `advanced_settings` functionality to:
8+
* `application_management`
9+
* `application_management.profiles`
10+
* `access_broker.profiles`
11+
* Added `global_settings.itsm` functionality.
12+
13+
__Enhancements:__
14+
15+
* Added missing params for `secrets_manager.[secrets|vaults]` and `file` updates.
16+
17+
__Bug Fixes:__
18+
19+
* None
20+
21+
__Dependencies:__
22+
23+
* None
24+
25+
__Other:__
26+
27+
* Updated tests to use uniform naming convention.
28+
* Refactored `application_management.profiles` to break out classes for added clarity.
29+
330
## v4.1.3 [2025-03-07]
431

532
__What's New:__

src/britive/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '4.1.3'
1+
__version__ = '4.2.0'

src/britive/access_broker/profiles/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from britive.application_management.advanced_settings import AdvancedSettings
2+
13
from .permissions import Permissions
24
from .policies import Policies
35

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

src/britive/access_broker/profiles/policies.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ def create(
3333
:param condition: Condition of the policy.
3434
:param members: Dict of member type objects.
3535
Example: {
36-
users: [
36+
'users': [
3737
{'id': '...'}
3838
],
39-
tags: [
39+
'tags': [
4040
{'id': '...'}
4141
],
42-
tokens: [
42+
'tokens': [
4343
{'id': '...'}
4444
],
45-
serviceIdentities: [
45+
'serviceIdentities': [
4646
{'id': '...'}
4747
],
4848
}
@@ -111,16 +111,16 @@ def update(
111111
:param condition: Condition of the policy.
112112
:param members: Dict of member type objects.
113113
Example: {
114-
users: [
114+
'users': [
115115
{'id': '...'}
116116
],
117-
tags: [
117+
'tags': [
118118
{'id': '...'}
119119
],
120-
tokens: [
120+
'tokens': [
121121
{'id': '...'}
122122
],
123-
serviceIdentities: [
123+
'serviceIdentities': [
124124
{'id': '...'}
125125
],
126126
}

src/britive/application_management/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from .access_builder import AccessBuilderSettings
22
from .accounts import Accounts
3+
from .advanced_settings import AdvancedSettings
34
from .applications import Applications
45
from .environment_groups import EnvironmentGroups
56
from .environments import Environments
@@ -14,6 +15,7 @@ class ApplicationManagement:
1415
def __init__(self, britive) -> None:
1516
self.access_builder = AccessBuilderSettings(britive)
1617
self.accounts = Accounts(britive)
18+
self.advanced_settings = AdvancedSettings(britive)
1719
self.applications = Applications(britive)
1820
self.environment_groups = EnvironmentGroups(britive)
1921
self.environments = Environments(britive)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
class AdvancedSettings:
2+
def __init__(self, britive, base_url: str = '/apps/{}/advanced-settings') -> None:
3+
self.britive = britive
4+
self.base_url = self.britive.base_url + base_url
5+
6+
def create(self, entity_id: str, settings: dict) -> dict:
7+
"""
8+
Create Advanced Settings for a specific application or profile.
9+
10+
:param entity_id: The ID of the application or profile to create Advanced Settings for.
11+
:param settings: The Advanced Settings settings.
12+
:return: Details of the created Advanced Settings.
13+
"""
14+
15+
return self.britive.post(self.base_url.format(entity_id), json=settings)
16+
17+
def get(self, entity_id: str) -> dict:
18+
"""
19+
Get Advanced Settings for a specific application or profile.
20+
21+
:param entity_id: The ID of the application or profile to retrieve Advanced Settings for.
22+
:return: Details of the Advanced Settings.
23+
"""
24+
25+
return self.britive.get(self.base_url.format(entity_id))
26+
27+
def update(self, entity_id: str, settings: dict) -> dict:
28+
"""
29+
Update Advanced Settings for a specific application or profile.
30+
31+
:param entity_id: The ID of the application or profile to update Advanced Settings for.
32+
:param settings: The Advanced Settings settings to update.
33+
:return: Details of the updated Advanced Settings.
34+
"""
35+
36+
return self.britive.put(self.base_url.format(entity_id), json=settings)
37+
38+
def delete(self, entity_id: str, settings_id: str) -> None:
39+
"""
40+
Delete Advanced Settings for a specific application or profile.
41+
42+
:param entity_id: The ID of the application or profile associated with the Advanced Settings.
43+
:param settings_id: The ID of the Advanced Settings settings to delete.
44+
:return: None.
45+
"""
46+
47+
self.britive.delete(f'{self.base_url.format(entity_id)}/{settings_id}')

0 commit comments

Comments
 (0)