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
178 changes: 89 additions & 89 deletions dir-sdk-python/agntcy/dir_sdk/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,9 @@ def _server_name_from_addr(self, addr: str) -> str:
return addr.rsplit(":", 1)[0]

def publish(
self,
req: routing_v1.PublishRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: routing_v1.PublishRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> None:
"""Publish objects to the Routing API matching the specified criteria.

Expand Down Expand Up @@ -493,9 +493,9 @@ def publish(
raise RuntimeError(msg) from e

def list(
self,
req: routing_v1.ListRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: routing_v1.ListRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> list[routing_v1.ListResponse]:
"""List objects from the Routing API matching the specified criteria.

Expand Down Expand Up @@ -536,9 +536,9 @@ def list(
return results

def search_cids(
self,
req: search_v1.SearchCIDsRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: search_v1.SearchCIDsRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> builtins.list[search_v1.SearchCIDsResponse]:
"""Search for record CIDs matching the specified queries.

Expand Down Expand Up @@ -580,9 +580,9 @@ def search_cids(
return results

def search_records(
self,
req: search_v1.SearchRecordsRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: search_v1.SearchRecordsRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> builtins.list[search_v1.SearchRecordsResponse]:
"""Search for full records matching the specified queries.

Expand Down Expand Up @@ -623,9 +623,9 @@ def search_records(
return results

def unpublish(
self,
req: routing_v1.UnpublishRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: routing_v1.UnpublishRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> None:
"""Unpublish objects from the Routing API matching the specified criteria.

Expand Down Expand Up @@ -658,9 +658,9 @@ def unpublish(
raise RuntimeError(msg) from e

def push(
self,
records: builtins.list[core_v1.Record],
metadata: Sequence[tuple[str, str]] | None = None,
self,
records: builtins.list[core_v1.Record],
metadata: Sequence[tuple[str, str]] | None = None,
) -> builtins.list[core_v1.RecordRef]:
"""Push records to the Store API.

Expand Down Expand Up @@ -701,9 +701,9 @@ def push(
return results

def push_referrer(
self,
req: builtins.list[store_v1.PushReferrerRequest],
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: builtins.list[store_v1.PushReferrerRequest],
metadata: Sequence[tuple[str, str]] | None = None,
) -> builtins.list[store_v1.PushReferrerResponse]:
"""Push records with referrer metadata to the Store API.

Expand Down Expand Up @@ -744,9 +744,9 @@ def push_referrer(
return results

def pull(
self,
refs: builtins.list[core_v1.RecordRef],
metadata: Sequence[tuple[str, str]] | None = None,
self,
refs: builtins.list[core_v1.RecordRef],
metadata: Sequence[tuple[str, str]] | None = None,
) -> builtins.list[core_v1.Record]:
"""Pull records from the Store API by their references.

Expand Down Expand Up @@ -787,9 +787,9 @@ def pull(
return results

def pull_referrer(
self,
req: builtins.list[store_v1.PullReferrerRequest],
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: builtins.list[store_v1.PullReferrerRequest],
metadata: Sequence[tuple[str, str]] | None = None,
) -> builtins.list[store_v1.PullReferrerResponse]:
"""Pull records with referrer metadata from the Store API.

Expand Down Expand Up @@ -832,9 +832,9 @@ def pull_referrer(
return results

def lookup(
self,
refs: builtins.list[core_v1.RecordRef],
metadata: Sequence[tuple[str, str]] | None = None,
self,
refs: builtins.list[core_v1.RecordRef],
metadata: Sequence[tuple[str, str]] | None = None,
) -> builtins.list[core_v1.RecordMeta]:
"""Look up metadata for records in the Store API.

Expand Down Expand Up @@ -876,9 +876,9 @@ def lookup(
return results

def delete(
self,
refs: builtins.list[core_v1.RecordRef],
metadata: Sequence[tuple[str, str]] | None = None,
self,
refs: builtins.list[core_v1.RecordRef],
metadata: Sequence[tuple[str, str]] | None = None,
) -> None:
"""Delete records from the Store API.

Expand Down Expand Up @@ -909,9 +909,9 @@ def delete(
raise RuntimeError(msg) from e

def create_sync(
self,
req: store_v1.CreateSyncRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: store_v1.CreateSyncRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> store_v1.CreateSyncResponse:
"""Create a new synchronization configuration.

Expand Down Expand Up @@ -951,9 +951,9 @@ def create_sync(
return response

def list_syncs(
self,
req: store_v1.ListSyncsRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: store_v1.ListSyncsRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> builtins.list[store_v1.ListSyncsItem]:
"""List existing synchronization configurations.

Expand Down Expand Up @@ -998,9 +998,9 @@ def list_syncs(
return results

def get_sync(
self,
req: store_v1.GetSyncRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: store_v1.GetSyncRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> store_v1.GetSyncResponse:
"""Retrieve detailed information about a specific synchronization configuration.

Expand Down Expand Up @@ -1040,9 +1040,9 @@ def get_sync(
return response

def delete_sync(
self,
req: store_v1.DeleteSyncRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: store_v1.DeleteSyncRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> None:
"""Delete a synchronization configuration.

Expand Down Expand Up @@ -1075,9 +1075,9 @@ def delete_sync(
raise RuntimeError(msg) from e

def listen(
self,
req: events_v1.ListenRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: events_v1.ListenRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> grpc.UnaryStreamMultiCallable:
"""
Listen establishes a streaming connection to receive events.
Expand Down Expand Up @@ -1113,9 +1113,9 @@ def listen(
return stream

def create_publication(
self,
req: routing_v1.PublishRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: routing_v1.PublishRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> routing_v1.CreatePublicationResponse:
"""
Create publication creates a new publication request that will be processed by the PublicationWorker.
Expand Down Expand Up @@ -1147,9 +1147,9 @@ def create_publication(
return response

def get_publication(
self,
req: routing_v1.GetPublicationRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: routing_v1.GetPublicationRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> routing_v1.GetPublicationResponse:
"""
GetPublication retrieves details of a specific publication request by its identifier.
Expand Down Expand Up @@ -1180,9 +1180,9 @@ def get_publication(
return response

def list_publication(
self,
req: routing_v1.ListPublicationsRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: routing_v1.ListPublicationsRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> builtins.list[routing_v1.ListPublicationsItem]:
"""
ListPublications returns a stream of all publication requests in the system.
Expand Down Expand Up @@ -1217,10 +1217,10 @@ def list_publication(
return results

def resolve(
self,
name: str,
version: str | None = None,
metadata: Sequence[tuple[str, str]] | None = None,
self,
name: str,
version: str | None = None,
metadata: Sequence[tuple[str, str]] | None = None,
) -> naming_v1.ResolveResponse:
"""Resolve a record name to CIDs.

Expand Down Expand Up @@ -1264,11 +1264,11 @@ def resolve(
return response

def get_verification_info(
self,
cid: str | None = None,
name: str | None = None,
version: str | None = None,
metadata: Sequence[tuple[str, str]] | None = None,
self,
cid: str | None = None,
name: str | None = None,
version: str | None = None,
metadata: Sequence[tuple[str, str]] | None = None,
) -> naming_v1.GetVerificationInfoResponse:
"""Get verification info for a record.

Expand Down Expand Up @@ -1319,9 +1319,9 @@ def get_verification_info(
return response

def verify(
self,
req: sign_v1.VerifyRequest,
metadata: Sequence[tuple[str, str]] | None = None,
self,
req: sign_v1.VerifyRequest,
metadata: Sequence[tuple[str, str]] | None = None,
) -> sign_v1.VerifyResponse:
"""Verify a cryptographic signature on a record.

Expand Down Expand Up @@ -1411,10 +1411,10 @@ def verify(
pass

def _verify_with_key(
self,
record_ref: core_v1.RecordRef,
key_verifier: sign_v1.VerifyWithKey,
output_path: str,
self,
record_ref: core_v1.RecordRef,
key_verifier: sign_v1.VerifyWithKey,
output_path: str,
) -> None:
"""Verify a record using a public key.

Expand Down Expand Up @@ -1462,10 +1462,10 @@ def _verify_with_key(
raise RuntimeError(msg) from e

def _verify_with_any(
self,
record_ref: core_v1.RecordRef,
any_verifier: sign_v1.VerifyWithAny | None,
output_path: str,
self,
record_ref: core_v1.RecordRef,
any_verifier: sign_v1.VerifyWithAny | None,
output_path: str,
) -> None:
"""Verify a record using any valid signature.

Expand Down Expand Up @@ -1519,10 +1519,10 @@ def _verify_with_any(
raise RuntimeError(msg) from e

def _verify_with_oidc(
self,
record_ref: core_v1.RecordRef,
oidc_verifier: sign_v1.VerifyWithOIDC | None,
output_path: str,
self,
record_ref: core_v1.RecordRef,
oidc_verifier: sign_v1.VerifyWithOIDC | None,
output_path: str,
) -> None:
"""Verify a record using OIDC-based verification.

Expand Down Expand Up @@ -1608,8 +1608,8 @@ def _parse_verify_response(self, output: bytes) -> sign_v1.VerifyResponse:
raise RuntimeError(msg) from e

def sign(
self,
req: sign_v1.SignRequest,
self,
req: sign_v1.SignRequest,
) -> None:
"""Sign a record with a cryptographic signature.

Expand Down Expand Up @@ -1653,9 +1653,9 @@ def sign(
raise RuntimeError(msg) from e

def _sign_with_key(
self,
record_ref: core_v1.RecordRef,
key_signer: sign_v1.SignWithKey,
self,
record_ref: core_v1.RecordRef,
key_signer: sign_v1.SignWithKey,
) -> None:
"""Sign a record using a private key.

Expand Down Expand Up @@ -1709,9 +1709,9 @@ def _sign_with_key(
raise RuntimeError(msg) from e

def _sign_with_oidc(
self,
record_ref: core_v1.RecordRef,
oidc_signer: sign_v1.SignWithOIDC,
self,
record_ref: core_v1.RecordRef,
oidc_signer: sign_v1.SignWithOIDC,
) -> None:
"""Sign a record using OIDC-based authentication.

Expand Down
1 change: 0 additions & 1 deletion dir-sdk-python/agntcy/dir_sdk/client/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def __init__(
self.server_address = server_address
self.dirctl_path = dirctl_path
self.spiffe_socket_path = spiffe_socket_path
self.auth_mode = auth_mode # '', insecure, x509, jwt, tls, oidc
resolved_auth_token = auth_token or oidc_access_token or ""
self.auth_token = resolved_auth_token
# Backward-compatible alias for older callers.
Expand Down
Loading