GithubHelp home page GithubHelp logo

express-oauth2-handlers's Issues

Environment Variable Change in NodeJS 10+ Runtime

Per the Cloud Functions documentation, Node.js 10 and subsequent runtimes set fewer/different environment variables than previous runtimes. In particular, the FUNCTION_TRIGGER_TYPE environment variable no longer exists, and is replaced by the FUNCTION_SIGNATURE_TYPE variable instead.

This change causes non-HTTP triggered methods to be treated as if they were triggered by HTTP. While this can be corrected by manually setting FUNCTION_TRIGGER_TYPE, the library documentation warns against doing this.

Given that the Node.js 8 runtime will be deprecated June 5, 2020 and decommissioned Feb 15, 2021, the library should be adapted to work with Node.js 10+ runtimes.

Steps to reproduce

  1. Deploy a pub/sub topic triggered function which uses the library on the Node.js 10 runtime.
  2. Call any of the library methods, passing null as req and res parameter values (per the documentation).
  3. The error message Error: Please pass Express' "req" and "res" objects to this function when using HTTP(S). will be thrown.

@google-cloud/express-oauth2-handlers not detecting required keys from client_secret.json

I am trying to use @google-cloud/express-oauth2-handlers package in Firebase function to authorize user to then query google APIs.

I provided the required keys in client_secret.json file in root directory of my function/app as per npm instructions for this package, however it's still not detecting the required keys from the client_secret.json file. Its throwing me below error.

firebase deploy --only functions

=== Deploying to 'doppelganger-appl'...

i deploying functions
i functions: ensuring necessary APIs are enabled...
โœ” functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...

Error: Error occurred while parsing your function triggers.

Error: Missing required keys: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_CALLBACK_URL, GCP_PROJECT
at exports.Provider.Provider.required (/Users//my-doppelganger-app/functions/node_modules/nconf/lib/nconf/provider.js:364:11)
at Object. (/Users//my-doppelganger-app/functions/node_modules/@google-cloud/express-oauth2-handlers/config.js:53:7)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/Users//my-doppelganger-
app/functions/node_modules/@google-cloud/express-oauth2-
handlers/tokenStorage.js:17:16)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency sinon to v18
  • Update dependency swap-case to v3
  • Update dependency uuid to v10
  • Update linters (major) (eslint, eslint-config-prettier, eslint-plugin-node, eslint-plugin-prettier, prettier)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @google-cloud/datastore ^3.1.0
  • @google-cloud/kms ^0.3.0
  • cookie ^0.3.1
  • google-auth-library ^3.1.0
  • googleapis ^37.2.0
  • nconf ^0.10.0
  • pify ^4.0.1
  • sha.js ^2.4.11
  • sinon ^7.2.3
  • tweetnacl ^1.0.1
  • tweetnacl-util ^0.15.0
  • ava ^1.2.1
  • eslint ^5.14.1
  • eslint-config-prettier ^4.0.0
  • eslint-plugin-node ^8.0.1
  • eslint-plugin-prettier ^3.0.1
  • nyc ^13.3.0
  • prettier ^1.16.4
  • proxyquire ^2.1.0
  • swap-case ^1.1.2
  • uuid ^3.3.2
  • node >=8
samples/package.json
  • node >=8
system-test/function/package.json
  • @google-cloud/datastore ^3.1.0
  • @google-cloud/kms ^0.3.0
  • cookie ^0.3.1
  • google-auth-library ^3.1.0
  • googleapis ^37.2.0
  • nconf ^0.10.0
  • pify ^4.0.1
  • sha.js ^2.4.11
  • sinon ^7.2.3
  • tweetnacl ^1.0.1
  • tweetnacl-util ^0.15.0
  • ava ^1.2.1
  • eslint ^5.14.1
  • eslint-config-prettier ^4.0.0
  • eslint-plugin-node ^8.0.1
  • eslint-plugin-prettier ^3.0.1
  • prettier ^1.16.4
  • proxyquire ^2.1.0
  • swap-case ^1.1.2
  • uuid ^3.3.2
  • node >=8

  • Check this box to trigger a request for Renovate to run again on this repository

Publish type declarations for Typescript

First of all thank you very much for the excellent package.
I think it is very useful and it deserves more attention within Google docs. I found it by chance while exploring this

I am trying to use to use this library in a Google Cloud function written in TypeScript.
Unfortunately Typescript is complaining it cannot find a type declaration.

I would like this package to export type declarations like other packages e.g.:

{
  "name": "@google-cloud/functions-framework",
  "version": "1.7.1",
  "description": "FaaS (Function as a service) framework for writing portable Node.js functions",
  "engines": {
    "node": ">=10.0.0"
  },
  "repository": "GoogleCloudPlatform/functions-framework-nodejs",
  "main": "build/src/index.js",
  "types": "build/src/functions.d.ts",
  ...

Thank you very much for you work and thank you in advance if you'll find time to have a look at my request.

Filippo

'client_secret.json' is not found

Howdy y'all!

So I'm trying to get this to work while I have in my package.json "main": "src/index.js",

It seems to struggle to find the the client_secret.json file; thinking it's here: `/workspace/node_modules/@google-cloud/client_secret.json'. Is there a way to configure the location to look up a directory, or to tell it the path?

Thanks,
Kelly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.