hongaik commited on
Commit
a0d7b04
·
1 Parent(s): 0beed25
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -291,11 +291,17 @@ with st.form("inputs"):
291
  st_folium(m, width=700, height=450)
292
 
293
  # Log searches
 
 
 
 
 
 
294
 
295
  keydict = {'type': st.secrets["type"],
296
  'project_id': st.secrets["project_id"],
297
  'private_key_id': st.secrets["private_key_id"],
298
- 'private_key': st.secrets["private_key"].replace("\\r",''),
299
  'client_email': st.secrets["client_email"],
300
  'client_id': st.secrets["client_id"],
301
  'auth_uri': st.secrets["auth_uri"],
 
291
  st_folium(m, width=700, height=450)
292
 
293
  # Log searches
294
+ import re
295
+ r = re.compile("\s*-----BEGIN (.*)-----\n")
296
+ m = r.match(st.secrets["private_key"])
297
+ if not m:
298
+ raise ValueError("Not a valid PEM pre boundary")
299
+ st.write(m.group(1))
300
 
301
  keydict = {'type': st.secrets["type"],
302
  'project_id': st.secrets["project_id"],
303
  'private_key_id': st.secrets["private_key_id"],
304
+ 'private_key': st.secrets["private_key"],
305
  'client_email': st.secrets["client_email"],
306
  'client_id': st.secrets["client_id"],
307
  'auth_uri': st.secrets["auth_uri"],