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

EventBuilder::git_issue can create an invalid git issue event #758

Closed
dluvian opened this issue Feb 12, 2025 · 2 comments · Fixed by #764
Closed

EventBuilder::git_issue can create an invalid git issue event #758

dluvian opened this issue Feb 12, 2025 · 2 comments · Fixed by #764
Labels
bug Something isn't working
Milestone

Comments

@dluvian
Copy link
Contributor

dluvian commented Feb 12, 2025

Describe the bug

There is no check that enforces GitIssue::repository::kind == Kind::GitRepoAnnouncement.
Also why is Tag::alt(GIT_ISSUE_ALT) being added?

Expected behavior

Issues created with EventBuilder:::git_issue should always be valid, which means having an a-tag like ["a", "30617:<repo-owner-pubkey>:<repo-id>"], no other kinds allowed.

ref: nip34#issues

@dluvian dluvian added the bug Something isn't working label Feb 12, 2025
@dluvian
Copy link
Contributor Author

dluvian commented Feb 12, 2025

And the pubkey of the GitIssue::repository coordinate should be added as a p-tag.

@dluvian
Copy link
Contributor Author

dluvian commented Feb 12, 2025

And the coordinate always needs an identifier since GitRepos are parameterized-replaceable

@yukibtc yukibtc added this to the Release v0.40 milestone Feb 13, 2025
yukibtc added a commit that referenced this issue Feb 14, 2025
Fix `EventBuilder::git_issue` construction according to <https://github.com/nostr-protocol/nips/blob/ea36ec9ed7596e49bf7f217b05954c1fecacad88/34.md> revision.

Changes:
- Enforce repository address kind
- Tag public key of repo owner
- Remove `alt` tag
- Remove `public_keys` field from `GitIssue` since any kind of tag can be added with `EventBuilder::tags`
- Change `EventBuilder::git_issue` signature

Closes #758

Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
yukibtc added a commit that referenced this issue Feb 14, 2025
- Enforce repository address kind
- Tag public key of repo owner
- Remove git issue `alt` tag
- Remove `public_keys` field from `GitIssue` since any kind of tag can be added with `EventBuilder::tags`
- Change `EventBuilder::git_issue` signature

Fixes 631a966
Closes #758

Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
yukibtc added a commit that referenced this issue Feb 14, 2025
- Enforce repository address kind
- Tag public key of repo owner
- Remove git issue `alt` tag
- Remove `public_keys` field from `GitIssue` since any kind of tag can be added with `EventBuilder::tags`
- Change `EventBuilder::git_issue` signature

Fixes 631a966
Closes #758

Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
yukibtc added a commit that referenced this issue Feb 14, 2025
- Enforce repository address kind
- Tag public key of repo owner
- Remove git issue `alt` tag
- Remove `public_keys` field from `GitIssue` since any kind of tag can be added with `EventBuilder::tags`
- Change `EventBuilder::git_issue` signature

Fixes 631a966
Closes #758

Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
yukibtc added a commit that referenced this issue Feb 17, 2025
- Enforce repository address kind
- Verify that repository address is valid
- Tag public key of repo owner
- Remove git issue `alt` tag
- Remove `public_keys` field from `GitIssue` since any kind of tag can be added with `EventBuilder::tags`
- Change `EventBuilder::git_issue` signature
- Add unit test

Fixes 631a966
Closes #758

Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
yukibtc added a commit that referenced this issue Feb 17, 2025
- Enforce repository address kind
- Verify that repository address is valid
- Tag public key of repo owner
- Remove git issue `alt` tag
- Remove `public_keys` field from `GitIssue` since any kind of tag can be added with `EventBuilder::tags`
- Change `EventBuilder::git_issue` signature
- Add unit test

Fixes 631a966
Closes #758

Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
yukibtc added a commit that referenced this issue Feb 18, 2025
Fix NIP34 event construction according to <https://github.com/nostr-protocol/nips/blob/ea36ec9ed7596e49bf7f217b05954c1fecacad88/34.md> revision.

Closes #758
Pull-Request: #764

Acked-by: dluvian <dluvian@proton.me>
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants