Great work maht!

I hope to get to try it soon.

I will just note that this idiom has been deprecated:

enabled_apps=($enabled_apps openid )

Instead apps now have a conf_enable_myapp() function that one calls
from config files when you want to enable that app.

>From that function one calls the generic conf_enable_app myapp to do
the bookkeeping like adding to the enabled_apps list and so on. This
takes care of things like avoiding adding the same app twice to
enabled_apps and other convenient bits.

For example see the conf_enable_blagh:

fn conf_enable_blog {
    blagh_uri=$conf_wd
    blagh_dirs=$*
    if(~ $#blagh_dirs 0)
        blagh_dirs=( . )
    conf_enable_app blagh
}

As you see this also lets you avoid using external vars to configure
your app, and you can instead pass them as parameters to
conf_enable_yourapp, which can then set defaults, and other tricks and
partially hides the internal app representation of the configuration
(so if for example blagh_dirs was renamed, configurations wouldn't
break).

I guess I should document this somewhere, maybe after 1.0 ;)

But thanks again, great job!

Peace

uriel

On Sat, Jun 20, 2009 at 8:06 PM, Maht<[email protected]> wrote:
>
> Hi,
>
> while building my site I added support for http://www.clickpass.com/
> which is an OpenID provider for which you can use your Yahoo /
> Facebook / Hotmail / Google / other OpenID  account.
>
> http://www.proweb.co.uk/~matt/werc/openid_app.rc
>
> I expect it to work with other openID providers but I've not tried
>
> it expects a writeable directory in $datastore in which it can mkdir
> it sets OpenID_identity(1) to be the OpenID identity and
> OpenID_identity(2) to be the signature provided.
> It hashes them both (the signature with some random salt) and sets
> them as cookies (openid_identity & openid_sig)
> It writes $openid_sig to $datastore/$openid_identity/openids
> That way one OpenID can have multiple sign-ins going at once.
> When the cookie is supplied it (safely) does grep -s $openid_sig
> $datastore/$openid_identity/openids, if it is successful it also sets
> $OpenID_identity, so all your Werc code has to do is
>
> if(~ $#OpenID_identity 0)
>    echo not logged in with openid
> if not
>    echo logged in with open id
>
> (I check for 0 and not 2 in case we change the length of the list
> sometime!)
>
> The signature is only ever used once so I think it's ok to use it as
> entropy.
>
> For the clickpass widget you need to set a clickpass site key
>
> So, all in all, you need :
>
> datastore=/home/www/openids
> OpenID_clickpass_site_key=abcdefghijkl
> OpenID_redirect=/logged_in/
> enabled_apps=($enabled_apps openid )
>
>
>
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"werc" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/werc9?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to