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

Merged
merged 6 commits into from
Jun 16, 2025

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
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments - I'm not sure the restrictions are necessary

@jevy jevy requested a review from tstirrat15 June 11, 2025 15:47
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thank you!

@tstirrat15
Copy link
Contributor

The failures can be fixed with yarn run format. Can you run that and I'll re-approve?

@jevy jevy requested a review from tstirrat15 June 12, 2025 17:33
@tstirrat15 tstirrat15 merged commit c23f6bc into authzed:main Jun 16, 2025
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants