Cron文件 - 禁用访问权限(Google App Engine)

Pet*_*oip 0 cron google-app-engine yaml

我在Google App Engine中运行了一个cron文件.它似乎工作正常,但我不希望任何人能够访问该URL.

这是我的.cron文件:

cron:
- description: testing cron
url: /tester
schedule: every 1 minutes
Run Code Online (Sandbox Code Playgroud)

我尝试在"schedule"下添加"login:admin",但我得到:

enter code here
Error parsing yaml file:
Unexpected attribute 'login' for object of type <class 'google.appengine.api.croninfo.CronEntry'>.
Run Code Online (Sandbox Code Playgroud)

那么如何阻止某人调用url并运行应该自动化的脚本呢?

谢谢

mor*_*aes 7

您可以限制app.yaml中对URL的访问.为您的cron测试人员添加相应的条目:

application: hello-cron
version: 1
runtime: python
api_version: 1

handlers:
- url: /tester
  script: tester.py
  login: admin
Run Code Online (Sandbox Code Playgroud)