Skip to content

Commit aa550f7

Browse files
authored
add verification for deamon (#57)
add verification for deamon
2 parents 03b4e9e + 04003d5 commit aa550f7

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from constants import StatusCode
2+
import json
3+
4+
from utils import make_response
5+
6+
7+
def main(event, context):
8+
return make_response(
9+
status_code=StatusCode.SUCCESS_GET_CODE,
10+
body=json.dumps({"data": "success"})
11+
)

metering/serverless.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,35 @@ package:
3636
- .gitignore
3737

3838
functions:
39+
verify-deamon:
40+
handler: handlers/verify_handler.main
41+
role: ${file(./config.${self:provider.stage}.json):ROLE}
42+
vpc:
43+
securityGroupIds:
44+
- ${file(./config.${self:provider.stage}.json):SG1}
45+
- ${file(./config.${self:provider.stage}.json):SG2}
46+
subnetIds:
47+
- ${file(./config.${self:provider.stage}.json):VPC1}
48+
- ${file(./config.${self:provider.stage}.json):VPC2}
49+
events:
50+
- http:
51+
path: /verify
52+
method: get
53+
authorizer:
54+
type: request
55+
arn: ${file(./config.${self:provider.stage}.json):SIGN_AUTHORIZER}
56+
identitySource: ${file(./config.${self:provider.stage}.json):SIGN_HEADERS}
57+
cors:
58+
origin: ${self:custom.origin.${self:provider.stage}}
59+
headers:
60+
- Content-Type
61+
- X-Amz-Date
62+
- Authorization
63+
- X-Api-Key
64+
- X-Amz-Security-Token
65+
- X-Amz-User-Agent
66+
- x-requested-with
67+
3968
get-freecalls:
4069
handler: handlers/freecall_handler.main
4170
role: ${file(./config.${self:provider.stage}.json):ROLE}

0 commit comments

Comments
 (0)