2.0.5 • Published 9 months ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months 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.5-0

9 months ago

2.0.5

9 months ago

2.0.4

12 months ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.4.2

2 years ago

1.4.1

2 years ago

1.2.6

2 years ago

1.4.0

2 years ago

1.3.0-0

2 years ago

1.3.0-4

2 years ago

1.3.0-3

2 years ago

1.3.0-2

2 years ago

1.3.0-1

2 years ago

1.4.0-9

2 years ago

1.4.0-11

2 years ago

1.4.0-8

2 years ago

1.4.0-5

2 years ago

1.4.0-4

2 years ago

1.4.0-10

2 years ago

1.4.0-7

2 years ago

1.4.0-6

2 years ago

1.4.0-1

2 years ago

1.4.0-0

2 years ago

1.4.0-3

2 years ago

1.4.0-2

2 years ago

1.3.0-7

2 years ago

1.3.0-6

2 years ago

1.3.0-5

2 years ago

1.2.5

2 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago