don't auth if settings are not set to read #145

Closed
LiranCohen wants to merge 1 commits from nip42 into nip42
LiranCohen commented 2023-01-26 15:33:30 +00:00 (Migrated from github.com)
No description provided.
v0l (Migrated from github.com) reviewed 2023-01-26 15:35:16 +00:00
@ -352,6 +352,10 @@ export default class Connection {
}
async _OnAuthAsync(challenge: string): Promise<void> {
if(!this.Settings.read) {
v0l (Migrated from github.com) commented 2023-01-26 15:35:13 +00:00

I think we can always auth, because if you want to write an event but AUTH is required then it wont work

I think we can always auth, because if you want to write an event but AUTH is required then it wont work
LiranCohen (Migrated from github.com) reviewed 2023-01-26 15:38:23 +00:00
@ -352,6 +352,10 @@ export default class Connection {
}
async _OnAuthAsync(challenge: string): Promise<void> {
if(!this.Settings.read) {
LiranCohen (Migrated from github.com) commented 2023-01-26 15:38:22 +00:00

Hrm, I wonder if that's confusing.

I only noticed this because I was debugging and didn't realize my private relay was set to read = false, so after auth I wasn't getting any events.

I initially thought it didn't matter, but then realized writing is usually self-authed (since you're signing the message) but reading is where the NIP42 really matters.

I don't mind either way, just caught this as I was testing and it made me think a bit.

Can close if you think it can auth anyway, it won't hurt performance or anything (it's just a single message).

Hrm, I wonder if that's confusing. I only noticed this because I was debugging and didn't realize my private relay was set to read = false, so after auth I wasn't getting any events. I initially thought it didn't matter, but then realized writing is usually self-authed (since you're signing the message) but reading is where the NIP42 really matters. I don't mind either way, just caught this as I was testing and it made me think a bit. Can close if you think it can auth anyway, it won't hurt performance or anything (it's just a single message).
v0l (Migrated from github.com) reviewed 2023-01-26 15:43:21 +00:00
@ -352,6 +352,10 @@ export default class Connection {
}
async _OnAuthAsync(challenge: string): Promise<void> {
if(!this.Settings.read) {
v0l (Migrated from github.com) commented 2023-01-26 15:43:21 +00:00

Well the server doesn't know that you signed the event, that's the entire point of NIP42, its to prove that you own the key (DM'S)

Well the server doesn't know that you signed the event, that's the entire point of NIP42, its to prove that you own the key (DM'S)

Pull request closed

Sign in to join this conversation.
No description provided.