File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
BASE_URL = " "
2
- INITIALIZATION_VECTOR = " "
3
- ENCRYPTION_KEY = " "
2
+ PASSWORD_HEADER = " "
Original file line number Diff line number Diff line change 4
4
5
5
import google .cloud .firestore
6
6
import requests
7
- # The Firebase Admin SDK to access Cloud Firestore.
8
- from firebase_admin import firestore , initialize_app
7
+ from firebase_admin import initialize_app
9
8
# The Cloud Functions for Firebase SDK to create Cloud Functions and set up triggers.
10
9
from firebase_functions import firestore_fn , https_fn
10
+ from firebase_functions .params import StringParam
11
11
from git import Repo
12
12
13
13
app = initialize_app ()
14
14
15
- BASE_URL = os . environ . get ("BASE_URL" )
16
- PASSWORD_HEADER = os . environ . get ("PASSWORD_HEADER" )
15
+ BASE_URL = StringParam ("BASE_URL" )
16
+ PASSWORD_HEADER = StringParam ("PASSWORD_HEADER" )
17
17
18
18
def make_api_request (request_data ):
19
19
@@ -105,7 +105,7 @@ def parse(qn):
105
105
106
106
@https_fn .on_request (max_instances = 10 )
107
107
def addmessage (req : https_fn .Request ) -> https_fn .Response :
108
- if req .headers .get ("PASSWORD_HEADER" ) != PASSWORD_HEADER :
108
+ if req .headers .get ("PASSWORD_HEADER" ) != PASSWORD_HEADER and req . headers . get ( "password_header" ) != PASSWORD_HEADER :
109
109
return https_fn .Response (status = 403 )
110
110
111
111
problems = load_problems ()
You can’t perform that action at this time.
0 commit comments