Skip to content

Creating metadata object to not expose raw protobuf #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jevy
Copy link
Contributor

@jevy jevy commented May 15, 2025

The optionalTransactionMetadata is using the Struct object from the google protobuf package. Instead of exposing that to the client, it would be better to encapsulate that within the authzed library. This PR creates a utility to build the struct object.

So this enables the client to add relationships this way:

const writeRelationshipRequest = v1.WriteRelationshipsRequest.create({
  updates: [relationshipUpdate],
  optionalTransactionMetadata: v1.createStructFromObject({
    organization: licenseId,
  }),
});

@jevy jevy requested a review from a team as a code owner May 15, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant