coddingtonbear / obsidian-local-rest-api

Unlock your automation needs by interacting with your notes in Obsidian over a secure REST API.
MIT License
644 stars 59 forks source link

Allow auth with X-API-KEY header instead of Authorization header #61

Closed derekantrican closed 1 year ago

derekantrican commented 1 year ago

Resolves discussion #60

I also have pending changes to turn this on & off via a setting. Let me know if you would like me to commit those.

Part of me also wants to add a setting to make this user-customizable (eg something other than X-API-KEY) but maybe this is fine. Again, let me know your thoughts.

derekantrican commented 1 year ago

I imagine I will have to update some documentation somewhere - just point me in the right direction

derekantrican commented 1 year ago

@coddingtonbear any opinions on this? Could this be merged?

coddingtonbear commented 1 year ago

I'm still thinking about it; time is extremely precious lately, but apologies for the delay. I think my off-the-cuff thoughts are that I might nudge you into instead making the name of the Authorization header configurable (maybe via an unexposed setting, though?) and adding tests for this. In any case, it might be a couple weeks before I can find the time to give this the thought necessary; sorry about that!

derekantrican commented 1 year ago

No worries - I totally understand the "time is extremely precious lately" - me too!

Yeah, I was originally going down that path (customizable header name - or maybe customizable additional header?) but thought I'd create a PR with the minimum to see if that was fine & get your thoughts.

coddingtonbear commented 1 year ago

OK, I made similar changes to what you were using via https://github.com/coddingtonbear/obsidian-local-rest-api/pull/65 -- the main difference is that I went the approach of just making the name of the header containing the authorization information configurable.

This'll go out as part of the next release, which I hope to find some time to do within the next few days.

derekantrican commented 1 year ago

Awesome! That was a lot faster than I expected!

I'll check it out when I next get a chance (either tomorrow or Monday) but sounds great