Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Api v4 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Api v4 #1

wants to merge 2 commits into from

Conversation

philipn
Copy link

@philipn philipn commented Mar 12, 2014

I've done some work to make this work with the new LocalWiki and API v4. I've never written Ruby before, so this is a bit messy, but it appears to work in the cases I've tested it with.

The main functional difference is that posts are no longer made from the user's account and are instead made directly by the user associated with the main API key. This is because I do not yet see a way to securely allow the previous behavior: we can adapt the LocalWiki backend to allow superusers with API keys to post as any user (perhaps using a custom header), but the problem is that there is no way to authenticate the underlying email address, because email addresses can be so easily spoofed.

But this update should bring the script up to functioning status. It may need some polish, though. Other things worth looking at if this script is further developed:

  • https://github.com/codeforseattle/localwiki_client Ruby LocalWiki API client (will be updated for the new LocalWiki soon by @sethvincent)
  • Content quick adder localwiki/localwiki#659 We are experimenting with a similar logic, build into the native LocalWiki interface. If and when we build this, it would be nice to expose this via the API so that clients like this can just POST to an endpoint with an image and some HTML and have all of the EXIF, etc stuff taken care of automatically.
  • The region associated with the email client must be set manually in settings, but could also be inferred by looking at the location and doing a lookup in /maps, but i figure in this case this is the fastest way to get this running right now.

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.

None yet

1 participant