2.0.0 • Published 1 month ago

firebase-auth-arcgis-server-proxy v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

firebase-auth-arcgis-server-proxy

An authenticated Firebase function for proxying requests to ArcGIS Server services

Example Usage

import initProxy from 'firebase-auth-arcgis-server-proxy';

const options = {
  host: 'https://my-arcgis-server.com/,
  mappings: [
    {
      from: /^\/toolbox/,
      to: '/arcgis/rest/services/Electrofishing/Toolbox/GPServer',
      secrets: 'ARCGIS_SERVER_CREDENTIALS',
    },
    {
      from: /^\/mapservice/,
      to: '/arcgis/rest/services/Electrofishing/MapService/FeatureServer',
      secrets: 'ARCGIS_SERVER_CREDENTIALS',
    },
    {
      from: /^\/reference/,
      to: '/arcgis/rest/services/Electrofishing/Reference/MapServer',
      secrets: 'ARCGIS_SERVER_CREDENTIALS',
    },
  ],
  claimsCheck: (claims) => {
    if (process.env.FUNCTIONS_EMULATOR) {
      return true;
    }

    return !!claims.firebase?.sign_in_attributes?.customClaim;
  },
};

const [proxy, secrets] = initProxy(options);

export const maps = functions.runWith({ secrets }).https.onRequest(proxy);

host and mappings are required but checkClaims is optional. secrets must match the name of a Firebase Functions secret.

Set option verbose: true to turn on verbose logging.

2.0.0

1 month ago

1.4.2

7 months ago

1.4.1

7 months ago

1.2.6

11 months ago

1.4.0

10 months ago

1.3.0-0

11 months ago

1.3.0-4

11 months ago

1.3.0-3

11 months ago

1.3.0-2

11 months ago

1.3.0-1

11 months ago

1.4.0-9

10 months ago

1.4.0-11

10 months ago

1.4.0-8

10 months ago

1.4.0-5

10 months ago

1.4.0-4

10 months ago

1.4.0-10

10 months ago

1.4.0-7

10 months ago

1.4.0-6

10 months ago

1.4.0-1

10 months ago

1.4.0-0

10 months ago

1.4.0-3

10 months ago

1.4.0-2

10 months ago

1.3.0-7

10 months ago

1.3.0-6

10 months ago

1.3.0-5

11 months ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago