Skip to content
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

Operations contracts signing with JOSE #84

Closed
wants to merge 9 commits into from

Conversation

gagandeepb
Copy link

PoC/WIP

wip, possibly
We now create a json encodable elixir map from a proto struct, and then  encode as json it to create a signable canonical string encoding. On the verification side, the verified payload is now deserialized and returned as a proto struct.
jwk = JOSE.JWK.from_pem(pem_private_key)
updated_opts = [{:will_be_signed?, true} | opts]

{:ok, json_encodable_map} = Protobuf.JSON.to_encodable(struct, emit_unpopulated: false)
Copy link
Author

Choose a reason for hiding this comment

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

Default for emit_unpopulated is false. Just being explicit here.

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Hey @gagandeepb
I think we need to decide where to send the encoded data.
For me, it looks counterintuitive to send the payload in the signature field and send the data empty.
We should send the payload in data with the correct data type. If the time and expiration time are encapsuled there, we don't need new empty fields (if they are not needed for some validation in the receiver part)

Signed payloads sent as text not in signature attribute field.
This function, decode_json_trento_event, was observed to be not necessary with a bit of refactoring
@gagandeepb gagandeepb requested a review from arbulu89 February 3, 2025 10:36
@gagandeepb
Copy link
Author

As a consequence of the shared conversation around this topic facilitated by the doc shared elsewhere and this PoC, message signing/verification and the security properties it promises will be re-evaluated at a later point, once a better need for these properties is established.

@gagandeepb gagandeepb closed this Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants