Skip to content

Commit f8fdae3

Browse files
Update core to version a8be62a1
1 parent 08bdab5 commit f8fdae3

File tree

8 files changed

+402
-14
lines changed

8 files changed

+402
-14
lines changed

src/onepassword/core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from onepassword.errors import raise_typed_exception
55

6-
# In empirical tests, we determined that maximum message size that can cross the FFI boundary
6+
# In empirical tests, we determined that maximum message size that can cross the FFI boundary
77
# is ~128MB. Past this limit, FFI will throw an error and the program will crash.
88
# We set the limit to 50MB to be safe and consistent with the other SDKs (where this limit is 64MB), to be reconsidered upon further testing
99
MESSAGE_LIMIT = 50 * 1024 * 1024
@@ -33,7 +33,8 @@ async def _invoke(invoke_config):
3333
serialized_config = json.dumps(invoke_config)
3434
if len(serialized_config.encode()) > MESSAGE_LIMIT:
3535
raise ValueError(
36-
f"message size exceeds the limit of {MESSAGE_LIMIT} bytes, please contact 1Password at [email protected] or https://developer.1password.com/joinslack if you need help.")
36+
f"message size exceeds the limit of {MESSAGE_LIMIT} bytes, please contact 1Password at [email protected] or https://developer.1password.com/joinslack if you need help."
37+
)
3738
try:
3839
return await core.invoke(serialized_config)
3940
except Exception as e:
@@ -45,7 +46,8 @@ def _invoke_sync(invoke_config):
4546
serialized_config = json.dumps(invoke_config)
4647
if len(serialized_config.encode()) > MESSAGE_LIMIT:
4748
raise ValueError(
48-
f"message size exceeds the limit of {MESSAGE_LIMIT} bytes, please contact 1Password at [email protected] or https://developer.1password.com/joinslack if you need help.")
49+
f"message size exceeds the limit of {MESSAGE_LIMIT} bytes, please contact 1Password at [email protected] or https://developer.1password.com/joinslack if you need help."
50+
)
4951
try:
5052
return core.invoke_sync(serialized_config)
5153
except Exception as e:
462 KB
Binary file not shown.
487 KB
Binary file not shown.
559 KB
Binary file not shown.
476 KB
Binary file not shown.
742 KB
Binary file not shown.

src/onepassword/secrets.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .iterator import SDKIterator
55
from typing import Optional, List
66
from pydantic import TypeAdapter
7-
from .types import GeneratePasswordResponse, PasswordRecipe
7+
from .types import GeneratePasswordResponse, PasswordRecipe, ResolveAllResponse
88

99

1010
class Secrets:
@@ -35,6 +35,25 @@ async def resolve(self, secret_reference: str) -> str:
3535
response = TypeAdapter(str).validate_json(response)
3636
return response
3737

38+
async def resolve_all(self, secret_references: List[str]) -> ResolveAllResponse:
39+
"""
40+
Resolve takes in a list of secret references and returns the secrets they point to or errors if any.
41+
"""
42+
response = await _invoke(
43+
{
44+
"invocation": {
45+
"clientId": self.client_id,
46+
"parameters": {
47+
"name": "SecretsResolveAll",
48+
"parameters": {"secret_references": secret_references},
49+
},
50+
}
51+
}
52+
)
53+
54+
response = TypeAdapter(ResolveAllResponse).validate_json(response)
55+
return response
56+
3857
@staticmethod
3958
def validate_secret_reference(secret_reference: str) -> None:
4059
"""

0 commit comments

Comments
 (0)