Arc Forumnew | comments | leaders | submitlogin
OpenID consumer support for Arc, release v1
4 points by CatDancer 6292 days ago | 8 comments
Here's a new iteration of my code to provide OpenID consumer support for Arc applications: http://catdancer.ws/arc/openid1.tar

All code and patches are released to the public domain.

This release implements the last step of the OpenID verification process: coming back to the web site from the OpenID server, doing something with the verified OpenID such as saving the login in a cookie, and then redirecting the browser to a friendly URL on the web site.

srv in arc1 has regular ops which display an HTML page, raw ops which allow headers (such as setting a cookie) to be added when an HTML page is displayed, and redirect ops which redirect the browser to a new location. To get the right user experience I needed to set a cookie and redirect; rather than introduce yet another permutation (a "raw redirect" op), instead I introduced a "superraw" op (for lack of a better name) which is responsible for generating all of the headers of its response.

With this addition the design of srv.arc is getting a bit cluttered with special case op handling, but my goal for today was to get some working code.

Still to be done is miscellaneous code cleanup and passing the current page URL from the request to the JanRain library so that it can do its spoof checking.



2 points by nex3 6292 days ago | link

Could you add this to the wiki?

-----

1 point by CatDancer 6288 days ago | link

The conventions for Anarki say to use docstrings for documentation, and I disagree (http://arclanguage.org/item?id=2888)

-----

1 point by nex3 6288 days ago | link

From the CONVENTIONS file:

"It's useful for functions and macros to include docstrings, although this isn't mandatory to encourage exploratory programming."

-----

1 point by CatDancer 6288 days ago | link

So someone usefully adds docstrings to the OpenID code in Anarki, and when I push my next version I'd need to be dealing with code that has docstrings in it.

I think it's perfectly fine that Anarki prefers to have its documentation in docstrings. I welcome anyone who wants to to add the OpenID code to Anarki to do so (it's in the public domain, after all). If you had said, "can I add this to Anarki", I'd say "sure, I'd be delighted". If there are any patches that would help make my code easier to incorporate into your distribution, I'd be happy to consider them.

But your question was "could you add it to Anarki". The answer is no, I'm not going to take the time to be a downstream maintainer for code in a distribution that has conventions that I don't like. In fact, I'm not sure I'd become a downstream maintainer of code in a distribution that I did like.

Everyone, every single person, has exactly the same amount of time. We all have 24 hours in the day. We all have different goals, different desires. If someone out there likes the direction Anarki is going in and thinks this OpenID code I wrote is useful and wants to spend some of the limited time they have to add it to Anarki, I'm delighted. More power to you, whoever you are.

And if no one wants to take the time to do that, that's OK with me too! :-)

-----

1 point by nex3 6288 days ago | link

I don't suppose you'd be willing to put your OpenID stuff in a git fork of the Anarki official branch, then? The official branch is just arcn.tar, and it would allow us to easily share patches back and forth.

If you need hosting, I have more GitHub invites than I know what to do with.

If not, that's fine, too, of course.

-----

1 point by CatDancer 6287 days ago | link

I am in fact leaning towards basing my projects on your new stable branch. arcn + bug fixes sounds like a good place to build upon ^_^ Plus I could see myself cherrypicking particular functionality that I want from the wiki.

I did my first commit using git ever this morning pushing the atomic-invoke bug fix to the stable branch... let me know if I did everything in the right way in terms of the log message and so on; I know nothing about what typical git project conventions are.

-----

1 point by nex3 6287 days ago | link

You got it just right - first commit line is the subject, after that is a more detailed description, etc.

Anyway, let me know if you want that GitHub invite.

-----

1 point by CatDancer 6287 days ago | link

Great!

I assume that once I read some more of the git tutorials I'll discover I can easily publish at least a read-only copy of my git repository off of my web site, yes?

-----