https://github.com/agrc/firebase-auth-arcgis-server-proxy
An authenticated Firebase function for proxying requests to ArcGIS Server services
https://github.com/agrc/firebase-auth-arcgis-server-proxy
government-app npm-package terraform-managed
Last synced: 3 days ago
JSON representation
An authenticated Firebase function for proxying requests to ArcGIS Server services
- Host: GitHub
- URL: https://github.com/agrc/firebase-auth-arcgis-server-proxy
- Owner: agrc
- License: mit
- Created: 2022-05-25T17:19:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-09-01T07:49:26.000Z (about 1 month ago)
- Last Synced: 2025-09-20T02:23:50.935Z (18 days ago)
- Topics: government-app, npm-package, terraform-managed
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/firebase-auth-arcgis-server-proxy
- Size: 623 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# firebase-auth-arcgis-server-proxy
An authenticated Firebase function for proxying requests to ArcGIS Server services
## Example Usage
```js
import initProxy from '@ugrc/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](https://firebase.google.com/docs/functions/config-env#create-secret).
Set option `verbose: true` to turn on verbose logging.