Hey,

Regarding the now code .

I think its awesome.

Immediate question is though, how I could replace py4web build in auth with
an outside IDM using OIDC/Oauth2?
I understand since Py4web is so modular now, I can figure it out myself
with 3rd party components.
But I think it would be a common use case and it would be great to just be
able to define an external auth server, client secret and id and secret in
a json file and just use
the build in py4web decorators no?

Apart from that, unrelated to this, just to confirm.. mtable is gone or is
it still usable.. in scope going forward?

Thanks!



On Sat, Feb 1, 2020 at 5:55 AM Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:

> I committed some new code to py4web
>
> Now you can do:
>
> from . common import authenticated, unauthenticated # from latest _scaffold
>
> # exposes index as /{app_name}/index and uses index.html or generic.html
> template, auth.user, db, T, session
> @authenticated()
> def index():
>       return dict()
>
> # GET only
> @authenticated.get()
> def index():
>       return dict()
>
> # exposes /{app_name}/index/<a>/<b>/<c>
> @authenticated.get()
> def index(a,b,c):
>       return dict()
>
> # more explicit
> @authenticated.get("index/<a:int>/<b:int>/<c:re:.*>)
> def index(a,b,c):
>       return dict()
>
> Some magic
>
> # define a button that make the following serverside POST callback
> @unauthenticated.button("click me")
> def a_button(msg):
>     print("you clicked the button and server received:", msg)
>
> # expose a page that displays the button which - onclick - makes the
> ballback
> @unauthenticated.get()
> def show_a_button():
>     return dict(mybutton = a_button(msg="hello world"))
>
> Thoughts? Should we keep this API? Can we improve it?
>
>
>
>
>
>
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/9261e53e-d45b-4be1-82e8-2d19a488df78%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/9261e53e-d45b-4be1-82e8-2d19a488df78%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CADHCKLQ33OtigmG%2BdYChqZ6_6HPE3Qiia3ySqQbzxfrBgoNCsQ%40mail.gmail.com.

Reply via email to