refreshing of basic_auth.users possible?

"Peter C. Miller" <[email protected]> Tue, 24 Sep 2019 23:39:34 -0700 (PDT)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
------=_Part_2665_380434431.1569393574518
Content-Type: multipart/alternative; 
	boundary="----=_Part_2666_943400332.1569393574518"

------=_Part_2666_943400332.1569393574518
Content-Type: text/plain; charset="UTF-8"

I have user auth working well in cherrypy with code below. 

The problem I'm having is that if the target database of users gets updated 
- e.g. user adds or updates a password, cherrypy doesn't seem to know about 
it because it only brings in the data once at launch via below 
'get_users()' method. the get_users simply returns a manual key value dict 
scraped form a pymongo_db.

Restarting cherrpy 'solves' the problem, but obviously realtime connection 
or update is needed.

I've tried setting basic_auth.users to just method name rather than the 
data coming from an actual call, and also best guesses at cherrypy config 
update calls, but no joy. 

Can't find update examples either. 

No luck with direct setting to pymongo db either.

Would greatly appreciate it if anyone out there has some pointers.

auth_users_config = {
    'tools.basic_auth.on': True,
    'tools.basic_auth.users': get_users(), 
    'tools.basic_auth.realm': 'some.place.out.there',
    'tools.basic_auth.encrypt': pwe
}

.....

sslConfig = {
    # Users access:
    '/ExternalResource': auth_users_config,

.....

https_cp_app = cherrypy.tree.mount(api_sub_domain_container.dev,
                                               '/a_mount',
                                               sslConfig)

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To view this discussion on the web visit https://groups.google.com/d/msgid/cherrypy-users/1acd7645-3603-4179-9d9f-4a882d9efee2%40googlegroups.com.

------=_Part_2666_943400332.1569393574518
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I have user auth working well in cherrypy with code below.=
 <br><br>The problem I&#39;m having is that if the target database of users=
 gets updated - e.g. user adds or updates a password, cherrypy doesn&#39;t =
seem to know about it because it only brings in the data once at launch via=
 below &#39;get_users()&#39; method. the get_users simply returns a manual =
key value dict scraped form a pymongo_db.<br><br>Restarting cherrpy &#39;so=
lves&#39; the problem, but obviously realtime connection or update is neede=
d.<br><br>I&#39;ve tried setting basic_auth.users to just method name rathe=
r than the data coming from an actual call, and also best guesses at cherry=
py config update calls, but no joy. <br><br>Can&#39;t find update examples =
either. <br><br>No luck with direct setting to pymongo db either.<br><br>Wo=
uld greatly appreciate it if anyone out there has some pointers.<br><br>aut=
h_users_config =3D {<br>=C2=A0=C2=A0=C2=A0 &#39;tools.basic_auth.on&#39;: T=
rue,<br>=C2=A0=C2=A0=C2=A0 &#39;tools.basic_auth.users&#39;: get_users(), <=
br>=C2=A0=C2=A0=C2=A0 &#39;tools.basic_auth.realm&#39;: &#39;some.place.out=
.there&#39;,<br>=C2=A0=C2=A0=C2=A0 &#39;tools.basic_auth.encrypt&#39;: pwe<=
br>}<br><br>.....<br><br>sslConfig =3D {<br>=C2=A0=C2=A0=C2=A0 # Users acce=
ss:<br>=C2=A0=C2=A0=C2=A0 &#39;/ExternalResource&#39;: auth_users_config,<b=
r><br>.....<br><br>https_cp_app =3D cherrypy.tree.mount(api_sub_domain_cont=
ainer.dev,<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &#39;/a_=
mount&#39;,<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sslConfi=
g)<br><br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;cherrypy-users&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:cherrypy-users+unsubscribe-/[email protected]">cher=
rypy-users+unsubscribe-/[email protected]</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/cherrypy-users/1acd7645-3603-4179-9d9f-4a882d9efee2%40googlegrou=
ps.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/=
msgid/cherrypy-users/1acd7645-3603-4179-9d9f-4a882d9efee2%40googlegroups.co=
m</a>.<br />

------=_Part_2666_943400332.1569393574518--

------=_Part_2665_380434431.1569393574518--