snappass icon indicating copy to clipboard operation
snappass copied to clipboard

First working API implementation

Open jameswthorne opened this issue 8 years ago • 14 comments

This is my attempt at adding an API to SnapPass. I used this implementation about 8 months ago when I needed to generate a lot of SnapPass URLs for a project at my previous employer.

It was previously mentioned by one of the maintainers they wanted to keep apart the web form code and any API code. This doesn't currently do that, but I am interested in discussing the appropriate way to do that.

jameswthorne avatar Jan 12 '17 14:01 jameswthorne

Now that SnapPass supports multi-line passwords/secrets, I don't know the best way to handle that when POSTing via curl.

jameswthorne avatar Jan 12 '17 14:01 jameswthorne

I'm working on applying your suggested fixes.

Is there a way to not have the abort() function output HTML?

jameswthorne avatar Jan 13 '17 02:01 jameswthorne

Is there a way to not have the abort() function output HTML?

Yes, that's where the errorhandler bit comes in:

@app.errorhandler(404)
def not_found(error):
    message = {
        'status': error.status_code,
        'message': 'Not Found: ' + request.url,
    }

    return make_response(jsonify(message), error.status_code)

jparise avatar Jan 13 '17 02:01 jparise

Hey just letting you know this is not dead. I just need to find a little time to review it, probably in the next week or so!

nichochar avatar May 03 '17 03:05 nichochar

Hey @nichochar, no problem! No rush at all. I haven't had a chance to dive back into this yet.

jameswthorne avatar May 03 '17 03:05 jameswthorne

Any progress on this one?

TalosThoren avatar Nov 01 '17 14:11 TalosThoren

Any progress on this getting rolled into the main build?

bryanpost avatar Jan 29 '18 20:01 bryanpost

Looking back at this, it looks pretty good. One thing that is missing that I'd love to see is some tests.

I think that with a rebase and some tsts we can pull it in @jameswthorne. Let me know if you're still interested in contributing, we've been a little slow to respond! If not I'll take this over and push it through, since I think an API is a good idea.

nichochar avatar May 07 '18 16:05 nichochar

Hey @nichochar

It's been sometime since I've looked over the code. I will try and find sometime this week to rebase and review.

jameswthorne avatar Jun 05 '18 15:06 jameswthorne

Awesome thanks @jameswthorne. Let me know if this is hard for you and I'm happy to commandeer the PR, it's up to you!

nichochar avatar Jun 06 '18 02:06 nichochar

I rebased from the latest master and incorporated suggested fixes from @coyotwill.

I still need to incorporate the necessary tests.

jameswthorne avatar Jul 01 '18 19:07 jameswthorne

How life gets in the way. I'm planning on rebasing from master and writing the tests this month.

jameswthorne avatar Jan 16 '19 14:01 jameswthorne

Came here looking for an API for SnapPass. Any progress on getting this baked in? Thank you.

silverl avatar Jul 05 '19 14:07 silverl

Was hoping there would be an update to this, but it seems the PR author has gone silent. Would be great if somebody could pick this back up.

Dragonpark avatar Jan 23 '20 20:01 Dragonpark