Skip to content

Commit eca8968

Browse files
authored
Remove vault group permission operations (#186)
Currently, they're not working as expected to be part of a beta release. They will be brought back once they're in a working state.
1 parent b38e88f commit eca8968

File tree

7 files changed

+0
-113
lines changed

7 files changed

+0
-113
lines changed
-6.03 KB
Binary file not shown.
-139 KB
Binary file not shown.
-99.2 KB
Binary file not shown.
-111 KB
Binary file not shown.
-95.5 KB
Binary file not shown.

src/onepassword/types.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -242,47 +242,12 @@ class Group(BaseModel):
242242
vault_access: Optional[List[VaultAccess]] = Field(alias="vaultAccess", default=None)
243243

244244

245-
class GroupAccess(BaseModel):
246-
"""
247-
Represents a group's access to a 1Password vault.
248-
This is used for granting permissions
249-
"""
250-
251-
group_id: str
252-
"""
253-
The group's ID
254-
"""
255-
permissions: int
256-
"""
257-
The group's set of permissions for the vault
258-
"""
259-
260-
261245
class GroupGetParams(BaseModel):
262246
model_config = ConfigDict(populate_by_name=True)
263247

264248
vault_permissions: Optional[bool] = Field(alias="vaultPermissions", default=None)
265249

266250

267-
class GroupVaultAccess(BaseModel):
268-
"""
269-
Represents a group's access to a 1Password vault.
270-
"""
271-
272-
vault_id: str
273-
"""
274-
The vault's ID
275-
"""
276-
group_id: str
277-
"""
278-
The group's ID
279-
"""
280-
permissions: int
281-
"""
282-
The group's set of permissions for the vault
283-
"""
284-
285-
286251
class ItemCategory(str, Enum):
287252
LOGIN = "Login"
288253
SECURENOTE = "SecureNote"
@@ -1528,19 +1493,3 @@ class WordListType(str, Enum):
15281493
"""
15291494
Three (random) letter "words"
15301495
"""
1531-
1532-
1533-
ARCHIVE_ITEMS: int = 256
1534-
CREATE_ITEMS: int = 128
1535-
DELETE_ITEMS: int = 512
1536-
EXPORT_ITEMS: int = 4194304
1537-
IMPORT_ITEMS: int = 2097152
1538-
MANAGE_VAULT: int = 2
1539-
NO_ACCESS: int = 0
1540-
PRINT_ITEMS: int = 8388608
1541-
READ_ITEMS: int = 32
1542-
RECOVER_VAULT: int = 1
1543-
REVEAL_ITEM_PASSWORD: int = 16
1544-
SEND_ITEMS: int = 1048576
1545-
UPDATE_ITEMS: int = 64
1546-
UPDATE_ITEM_HISTORY: int = 1024

src/onepassword/vaults.py

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from typing import Optional, List
55
from pydantic import TypeAdapter
66
from .types import (
7-
GroupAccess,
8-
GroupVaultAccess,
97
Vault,
108
VaultGetParams,
119
VaultListParams,
@@ -75,63 +73,3 @@ async def get(self, vault_uuid: str, vault_params: VaultGetParams) -> Vault:
7573

7674
response = TypeAdapter(Vault).validate_json(response)
7775
return response
78-
79-
async def grant_group_permissions(
80-
self, vault_id: str, group_permissions_list: List[GroupAccess]
81-
) -> None:
82-
response = await self.core.invoke(
83-
{
84-
"invocation": {
85-
"clientId": self.client_id,
86-
"parameters": {
87-
"name": "VaultsGrantGroupPermissions",
88-
"parameters": {
89-
"vault_id": vault_id,
90-
"group_permissions_list": [
91-
o.model_dump(by_alias=True)
92-
for o in group_permissions_list
93-
],
94-
},
95-
},
96-
}
97-
}
98-
)
99-
100-
return None
101-
102-
async def update_group_permissions(
103-
self, group_permissions_list: List[GroupVaultAccess]
104-
) -> None:
105-
response = await self.core.invoke(
106-
{
107-
"invocation": {
108-
"clientId": self.client_id,
109-
"parameters": {
110-
"name": "VaultsUpdateGroupPermissions",
111-
"parameters": {
112-
"group_permissions_list": [
113-
o.model_dump(by_alias=True)
114-
for o in group_permissions_list
115-
]
116-
},
117-
},
118-
}
119-
}
120-
)
121-
122-
return None
123-
124-
async def revoke_group_permissions(self, vault_id: str, group_id: str) -> None:
125-
response = await self.core.invoke(
126-
{
127-
"invocation": {
128-
"clientId": self.client_id,
129-
"parameters": {
130-
"name": "VaultsRevokeGroupPermissions",
131-
"parameters": {"vault_id": vault_id, "group_id": group_id},
132-
},
133-
}
134-
}
135-
)
136-
137-
return None

0 commit comments

Comments
 (0)