Skip to content
This repository has been archived by the owner on Feb 28, 2025. It is now read-only.

Contact Operations – Registry – FetchKeyPackages #20

Closed
jac18281828 opened this issue Jan 5, 2024 Discussed in #15 · 0 comments · Fixed by #55
Closed

Contact Operations – Registry – FetchKeyPackages #20

jac18281828 opened this issue Jan 5, 2024 Discussed in #15 · 0 comments · Fixed by #55
Assignees
Labels
enhancement New feature or request registry

Comments

@jac18281828
Copy link
Contributor

jac18281828 commented Jan 5, 2024

Discussed in #15

Originally posted by jac18281828 December 22, 2023
Initial discussion is here

Device installation is supported by GrantInstallation.
Device removal is supported by RevokeInstallation.

Retrieval of device current valid installations is supported by FetchKeyPackages.

JSON-RPC Endpoint Documentation

Request:

  • Method: POST
  • URL: /rpc/v1/fetchKeyPackages
  • Headers:
    • Content-Type: application/json
  • Body:
    • JSON Object:
      • jsonrpc: "2.0"
      • method: "fetchKeyPackages"
      • params: Array (optional parameters as required)
      • id: Request identifier (integer or string)

Endpoint: fetchKeyPackages

Description

The fetchKeyPackages endpoint is responsible for retrieving the contact bundle for the XMTP device installations. The request must be made to a valid did with an XMTP profile.

Request

The request for this endpoint should contain a valid DID. All returned information is public.

Parameters:
  • DID (string): Unique XMTP identifier for the user requesting the installation.
Example Request:
{
    "jsonrpc": "2.0",
    "method": "fetchKeyPackages",
    "params": {
        "did": "12345"
    },
    "id": 1
}

Response

The response will provide an optionally empty list of installation bundles.

Result Fields:
  • status (string): The status of the request, e.g., 'success'.
  • installation (array): Array of installation bundles.
Example Response:
{
    "jsonrpc": "2.0",
    "result": {
        "status": "success",
        "installation": ["bundle1...", "bundle2..."]
    },
    "id": 1
}

Error Handling

In case of an error, the response will include an error object with details.

Error Object Fields:
  • code (integer): Numeric code representing the error type.
  • message (string): Description of the error.
Example Error Response:
{
    "jsonrpc": "2.0",
    "error": {
        "code": 403,
        "message": "User not authorized for installation."
    },
    "id": 1
}

Security Considerations

All requests to fetchKeyPackages must be made over a secure channel. Ensure that user and application IDs are validated, and proper authentication mechanisms are in place to prevent unauthorized requests.

@jac18281828 jac18281828 added enhancement New feature or request registry labels Jan 5, 2024
@ericxmtp ericxmtp moved this to In Progress in D14N Work Jan 8, 2024
@ericxmtp ericxmtp moved this from In Progress to Todo in D14N Work Jan 8, 2024
@jac18281828 jac18281828 self-assigned this Jan 10, 2024
@jac18281828 jac18281828 changed the title Contact Operations – Registry – FetchInstallation Contact Operations – Registry – FetchKeyPackages Jan 13, 2024
@insipx insipx assigned insipx and unassigned jac18281828 Jan 18, 2024
@ericxmtp ericxmtp moved this from Todo to In Progress in D14N Work Jan 22, 2024
@insipx insipx closed this as completed in #55 Feb 8, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in D14N Work Feb 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request registry
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants