René's URL Explorer Experiment


Title: API management for multiple APIs only work for one. · Issue #188 · cloudendpoints/endpoints-python · GitHub

Open Graph Title: API management for multiple APIs only work for one. · Issue #188 · cloudendpoints/endpoints-python

X Title: API management for multiple APIs only work for one. · Issue #188 · cloudendpoints/endpoints-python

Description: I struggled to get multiple APIs working correctly for days. After I deployed the service using the steps below, although both api require api key, the problems are: I can call one of them without providing api key while the other does r...

Open Graph Description: I struggled to get multiple APIs working correctly for days. After I deployed the service using the steps below, although both api require api key, the problems are: I can call one of them without ...

X Description: I struggled to get multiple APIs working correctly for days. After I deployed the service using the steps below, although both api require api key, the problems are: I can call one of them without ...

Opengraph URL: https://github.com/cloudendpoints/endpoints-python/issues/188

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"API management for multiple APIs only work for one.","articleBody":"I struggled to get multiple APIs working correctly for days.\r\nAfter I deployed the service using the steps below, although both api require api key,  the problems are:\r\n1. **I can call one of them without providing api key while the other does require an api key.**\r\n2. Only one of the API are showing up in developer portal. Sometimes AuthedGreetingApi, sometimes GreetingApi.\r\n \r\nIs this a bug for cloud endpoints?\r\n\r\n```\r\npython lib/endpoints/endpointscfg.py get_openapi_spec main.GreetingApi main.AuthedGreetingApi --hostname inner-cinema-211407.appspot.com --x-google-api-name\r\n```\r\nthis generates `greetingv1openapi.json` and `authedgreetingv1openapi.json` \r\n\r\n\r\n```\r\ngcloud endpoints services deploy greetingv1openapi.json authedgreetingv1openapi.json \r\nresult: Service Configuration [2019-01-07r9] uploaded for service [inner-cinema-211407.appspot.com]\r\n```\r\nupdate the app.yaml as following:\r\n```\r\nenv_variables:\r\n  # The following values are to be replaced by information from the output of\r\n  # 'gcloud endpoints services deploy swagger.json' command.\r\n  ENDPOINTS_SERVICE_NAME: inner-cinema-211407.appspot.com\r\n  ENDPOINTS_SERVICE_VERSION: 2019-01-07r9\r\n```\r\ndeploy to GAE\r\n```\r\ngcloud app deploy --project=inner-cinema-211407\r\n```\r\nSource code:\r\n```python\r\n\r\n# [START messages]\r\nclass Greeting(messages.Message):\r\n    \"\"\"Greeting that stores a message.\"\"\"\r\n    message = messages.StringField(1)\r\n\r\n\r\nclass GreetingCollection(messages.Message):\r\n    \"\"\"Collection of Greetings.\"\"\"\r\n    items = messages.MessageField(Greeting, 1, repeated=True)\r\n\r\n\r\nSTORED_GREETINGS = GreetingCollection(items=[\r\n    Greeting(message='hello world!'),\r\n    Greeting(message='goodbye world!'),\r\n])\r\n\r\n\r\n# [END messages]\r\n\r\n\r\n# [START greeting_api]\r\n@endpoints.api(name='greeting', version='v1', api_key_required=True)\r\nclass GreetingApi(remote.Service):\r\n    @endpoints.method(\r\n        # This method does not take a request message.\r\n        message_types.VoidMessage,\r\n        # This method returns a GreetingCollection message.\r\n        GreetingCollection,\r\n        path='greetings',\r\n        http_method='GET',\r\n        name='greetings.list')\r\n    def list_greetings(self, unused_request):\r\n        return STORED_GREETINGS\r\n\r\n    # ResourceContainers are used to encapsuate a request body and url\r\n    # parameters. This one is used to represent the Greeting ID for the\r\n    # greeting_get method.\r\n    GET_RESOURCE = endpoints.ResourceContainer(\r\n        # The request body should be empty.\r\n        message_types.VoidMessage,\r\n        # Accept one url parameter: and integer named 'id'\r\n        id=messages.IntegerField(1, variant=messages.Variant.INT32))\r\n\r\n    @endpoints.method(\r\n        # Use the ResourceContainer defined above to accept an empty body\r\n        # but an ID in the query string.\r\n        GET_RESOURCE,\r\n        # This method returns a Greeting message.\r\n        Greeting,\r\n        # The path defines the source of the URL parameter 'id'. If not\r\n        # specified here, it would need to be in the query string.\r\n        path='greetings/{id}',\r\n        http_method='GET',\r\n        name='greetings.get')\r\n    def get_greeting(self, request):\r\n        try:\r\n            # request.id is used to access the URL parameter.\r\n            return STORED_GREETINGS.items[request.id]\r\n        except (IndexError, TypeError):\r\n            raise endpoints.NotFoundException(\r\n                'Greeting {} not found'.format(request.id))\r\n\r\n    # [END greeting_api]\r\n\r\n    # [START multiply]\r\n    # This ResourceContainer is similar to the one used for get_greeting, but\r\n    # this one also contains a request body in the form of a Greeting message.\r\n    MULTIPLY_RESOURCE = endpoints.ResourceContainer(\r\n        Greeting,\r\n        times=messages.IntegerField(2, variant=messages.Variant.INT32,\r\n                                    required=True))\r\n\r\n    @endpoints.method(\r\n        # This method accepts a request body containing a Greeting message\r\n        # and a URL parameter specifying how many times to multiply the\r\n        # message.\r\n        MULTIPLY_RESOURCE,\r\n        # This method returns a Greeting message.\r\n        Greeting,\r\n        path='greetings/multiply/{times}',\r\n        http_method='POST',\r\n        name='greetings.multiply')\r\n    def multiply_greeting(self, request):\r\n        return Greeting(message=request.message * request.times)\r\n        # [END multiply]\r\n\r\n\r\n# [START auth_config]\r\nWEB_CLIENT_ID = 'replace this with your web client application ID'\r\nANDROID_CLIENT_ID = 'replace this with your Android client ID'\r\nIOS_CLIENT_ID = 'replace this with your iOS client ID'\r\nANDROID_AUDIENCE = WEB_CLIENT_ID\r\nALLOWED_CLIENT_IDS = [\r\n    WEB_CLIENT_ID, ANDROID_CLIENT_ID, IOS_CLIENT_ID,\r\n    endpoints.API_EXPLORER_CLIENT_ID]\r\n\r\n\r\n# [END auth_config]\r\n\r\n\r\n# [START authed_greeting_api]\r\n@endpoints.api(\r\n    name='authedgreeting',\r\n    version='v1',\r\n    # Only allowed configured Client IDs to access this API.\r\n    allowed_client_ids=ALLOWED_CLIENT_IDS,\r\n    # Only allow auth tokens with the given audience to access this API.\r\n    audiences=[ANDROID_AUDIENCE],\r\n    api_key_required=True,\r\n    # Require auth tokens to have the following scopes to access this API.\r\n    scopes=[endpoints.EMAIL_SCOPE])\r\nclass AuthedGreetingApi(remote.Service):\r\n    @endpoints.method(\r\n        message_types.VoidMessage,\r\n        Greeting,\r\n        path='greet',\r\n        http_method='POST',\r\n        name='greet')\r\n    def greet(self, request):\r\n        user = endpoints.get_current_user()\r\n        user_name = user.email() if user else 'Anonymous'\r\n        return Greeting(message='Hello, {}'.format(user_name))\r\n\r\n\r\n# [END authed_greeting_api]\r\n\r\n\r\n# [START api_server]\r\napi = endpoints.api_server([GreetingApi, AuthedGreetingApi])\r\n# [END api_server]\r\n```","author":{"url":"https://github.com/zjaml","@type":"Person","name":"zjaml"},"datePublished":"2019-01-07T14:40:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/188/endpoints-python/issues/188"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:78422107-43b4-a25a-f703-30dd8db29073
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9606:8E478:1094DE:186CAD:6A4DFBA8
html-safe-nonce173b8181833017c5d9ab931c25f126fcd2e12128ff43f9b0f5e85b1f4e099e5a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjA2OjhFNDc4OjEwOTRERToxODZDQUQ6NkE0REZCQTgiLCJ2aXNpdG9yX2lkIjoiNzEyMDY5NTk5MzQzNjA3Njk2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac65212184894e54f3e5ccee8df00ff62ee9771c5f05de15f56778cdcf89364933
hovercard-subject-tagissue:396512567
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cloudendpoints/endpoints-python/188/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2fb4c54f43ba49882fd7774e940e63f7de3d13f10121914dc3d887a0fe72a4e7/cloudendpoints/endpoints-python/issues/188
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2fb4c54f43ba49882fd7774e940e63f7de3d13f10121914dc3d887a0fe72a4e7/cloudendpoints/endpoints-python/issues/188
og:image:altI struggled to get multiple APIs working correctly for days. After I deployed the service using the steps below, although both api require api key, the problems are: I can call one of them without ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamezjaml
hostnamegithub.com
expected-hostnamegithub.com
None5818716c93c6a2925b815402541a32814e43a7b1261c322b0c2df75224289566
turbo-cache-controlno-preview
go-importgithub.com/cloudendpoints/endpoints-python git https://github.com/cloudendpoints/endpoints-python.git
octolytics-dimension-user_id19231370
octolytics-dimension-user_logincloudendpoints
octolytics-dimension-repository_id65349604
octolytics-dimension-repository_nwocloudendpoints/endpoints-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id65349604
octolytics-dimension-repository_network_root_nwocloudendpoints/endpoints-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4314b1df11fa8a565684f3a72dc971e3785da365
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/cloudendpoints/endpoints-python/issues/188#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcloudendpoints%2Fendpoints-python%2Fissues%2F188
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcloudendpoints%2Fendpoints-python%2Fissues%2F188
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=cloudendpoints%2Fendpoints-python
Reloadhttps://github.com/cloudendpoints/endpoints-python/issues/188
Reloadhttps://github.com/cloudendpoints/endpoints-python/issues/188
Reloadhttps://github.com/cloudendpoints/endpoints-python/issues/188
Please reload this pagehttps://github.com/cloudendpoints/endpoints-python/issues/188
cloudendpoints https://github.com/cloudendpoints
endpoints-pythonhttps://github.com/cloudendpoints/endpoints-python
Notifications https://github.com/login?return_to=%2Fcloudendpoints%2Fendpoints-python
Fork 15 https://github.com/login?return_to=%2Fcloudendpoints%2Fendpoints-python
Star 50 https://github.com/login?return_to=%2Fcloudendpoints%2Fendpoints-python
Code https://github.com/cloudendpoints/endpoints-python
Issues 22 https://github.com/cloudendpoints/endpoints-python/issues
Pull requests 4 https://github.com/cloudendpoints/endpoints-python/pulls
Actions https://github.com/cloudendpoints/endpoints-python/actions
Projects https://github.com/cloudendpoints/endpoints-python/projects
Security and quality 0 https://github.com/cloudendpoints/endpoints-python/security
Insights https://github.com/cloudendpoints/endpoints-python/pulse
Code https://github.com/cloudendpoints/endpoints-python
Issues https://github.com/cloudendpoints/endpoints-python/issues
Pull requests https://github.com/cloudendpoints/endpoints-python/pulls
Actions https://github.com/cloudendpoints/endpoints-python/actions
Projects https://github.com/cloudendpoints/endpoints-python/projects
Security and quality https://github.com/cloudendpoints/endpoints-python/security
Insights https://github.com/cloudendpoints/endpoints-python/pulse
API management for multiple APIs only work for one.https://github.com/cloudendpoints/endpoints-python/issues/188#top
https://github.com/zjaml
zjamlhttps://github.com/zjaml
on Jan 7, 2019https://github.com/cloudendpoints/endpoints-python/issues/188#issue-396512567
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.