File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -348,11 +348,17 @@ def ret_val(exception):
348348api .add_resource (Health , '/health' )
349349
350350secrets_conf = pyzmutils .read_config (g .config ['secrets' ])
351+
351352g .config ['api_portal' ] = g .config ['api_portal' ] or pyzmutils .get (key = 'ZM_API_PORTAL' , section = 'secrets' , conf = secrets_conf )
352353g .config ['portal' ] = g .config ['portal' ] or pyzmutils .get (key = 'ZM_PORTAL' , section = 'secrets' , conf = secrets_conf )
353354g .config ['user' ] = g .config ['user' ] or pyzmutils .get (key = 'ZM_USER' , section = 'secrets' , conf = secrets_conf )
354355g .config ['password' ] = g .config ['password' ] or pyzmutils .get (key = 'ZM_PASSWORD' , section = 'secrets' , conf = secrets_conf )
355356
357+ if g .config ['auth_enabled' ] == 'no' :
358+ g .config ['user' ] = None
359+ g .config ['password' ] = None
360+ g .logger .Info ('Turning off auth for mlapi' )
361+
356362api_options = {
357363 'apiurl' : g .config ['api_portal' ],
358364 'portalurl' :g .config ['portal' ],
Original file line number Diff line number Diff line change 66# secrets=./secrets.ini
77secrets =/etc/zm/secrets.ini
88
9+ # portal/user/password are needed if you plan on using ZM's legacy
10+ # auth mechanism to get images
11+ portal =!ZM_PORTAL
12+ user =!ZM_USER
13+ password =!ZM_PASSWORD
14+
15+ # api portal is needed if you plan to use tokens to get images
16+ # requires ZM 1.33 or above
17+ api_portal =!ZM_API_PORTAL
18+
19+ # make this no, if you don't plan to use auth. Default is yes.
20+ auth_enabled =yes
921
1022# port that mlapi will listen on. Default 5000
1123port =5000
Original file line number Diff line number Diff line change 1818 'section' : 'general' ,
1919 'default' : None ,
2020 'type' : 'string' ,
21+ },
22+ 'auth_enabled' :{
23+ 'section' : 'general' ,
24+ 'default' : 'yes' ,
25+ 'type' : 'string' ,
2126 },
2227 'portal' :{
2328 'section' : 'general' ,
You can’t perform that action at this time.
0 commit comments