Add Firebase admin SDK

This commit is contained in:
ajmaley 2018-10-30 19:50:38 -04:00
parent 054c67db51
commit 88490b4f2d
5 changed files with 1135 additions and 294 deletions

1395
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,10 +5,13 @@
"dependencies": { "dependencies": {
"@material-ui/core": "^3.1.0", "@material-ui/core": "^3.1.0",
"@material-ui/icons": "^3.0.1", "@material-ui/icons": "^3.0.1",
"ajv": "^6.0.0",
"firebase": "^5.5.2", "firebase": "^5.5.2",
"firebase-admin": "^6.0.0", "firebase-admin": "^6.1.0",
"flamelink": "^0.19.2", "flamelink": "^0.19.2",
"google-maps-react": "^2.0.2", "google-maps-react": "^2.0.2",
"grpc": "^1.15.1",
"material-ui": "^1.0.0-beta.16",
"material-ui-icons": "^1.0.0-beta.36", "material-ui-icons": "^1.0.0-beta.36",
"moment": "^2.22.2", "moment": "^2.22.2",
"react": "^16.5.1", "react": "^16.5.1",

View File

@ -1,16 +1,13 @@
import firebase from 'firebase/app'; import firebase from 'firebase/app';
import 'firebase/database'; import 'firebase/database';
import 'firebase/storage'; import 'firebase/storage';
import * as admin from 'firebase-admin';
const config = { var serviceAccount = require('./keys/marten-application-firebase-adminsdk-zvjmp-c177ac648f.json');
apiKey: "AIzaSyAYf9AbeYwLY892NRiQfn0AMtG9xIFAJbo",
authDomain: "marten-application.firebaseapp.com",
databaseURL: "https://marten-application.firebaseio.com",
projectId: "marten-application",
storageBucket: "marten-application.appspot.com",
messagingSenderId: "659856510832"
};
const firebaseApp = firebase.initializeApp(config); const firebaseApp = admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: 'https://marten-application.firebaseio.com'
});
export default firebase; export default firebase;

View File

@ -1,6 +1,6 @@
import firebaseApp from './firebase.js'; import firebaseApp from './firebase.js';
import flamelink from 'flamelink'; import flamelink from 'flamelink';
const flamelinkApp = flamelink({ firebaseApp }); const flamelinkApp = flamelink({ firebaseApp, isAdminApp: true });
export default flamelinkApp; export default flamelinkApp;

View File

@ -0,0 +1,12 @@
{
"type": "service_account",
"project_id": "marten-application",
"private_key_id": "c177ac648f803d7e5e4398e4d7302ea4e6972c79",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDygOhbLLjSDLAd\n9B29umgVUrAn4/a1lGE04j6aQrjbgLa/NjU9u12dRiiOFDLX3QjEWFBcLYrU4Eb9\ncD48TJug+/Nc0nFjFk2GATmzlFnMzOaMCbH844TBX34h0UEgPt+iQh7g3cEH685a\nm0zlDXGOh88POvcTtez8S+2UMU6J+6mNh/ErRli3lTuD4zTGpZA3SyX8Us8aoFaG\njaC7P9T10M5kZWmGZMg6DiywX9xnjWPCI5hp1XE3SkyRQ1vpsA9lCPZPxb5QS2yM\nTYBd4Qh90kbEA0jVPIjIt8JwboFAV9UCuG4SQ44WnoSikvVYhU4esBIsmsKRD7bj\nrFATV5hxAgMBAAECggEABkfsVL22mwKm/lyd91W8V8aKr1rQP1Vcs+1i9pUBM5a8\nrPzNAdiAMQhR2TW42CZWgXrh2HRZxOAa+JobU42ep4uVCt+8vfa0OvL9zQrb7VH2\ni/SdlH2qWOWVt0+jnJ+iRFIq+XMm6nMLJwXAFuvrZ7gY5uWlpAAdl26KRJEHHive\niPK2Ri0bFqZ/xSSaNYmPKa4xRNKgpvarNcJPuiOdpzVq1G3S1TC7/DcYeWHxxHry\nPh/9RKPX5H5zzaObBw8jTMqFouh/BPw1CU5QLoHe1ApVvQ4ypkWf377/2eQArc77\ndGl0S0OI64UTb5ZQ5vE8KEVTdE/bjUhlJknQhZhZwQKBgQD6rtZEjMps0smTwfEY\nDmjuSjx6AbjiBtv1c8L3A5nmS3qz/hSqLoWp7EWvQyHRywV1nAXZJB1LNNUaFuio\nfgeC4xPgkd2Eurdj5VkAMeHpaX+Y5tBmm+U04lNjh6JsRFQYMMxgdGiySgbBFfjq\nddg67yK4uTMKlhETS1xzq+MzsQKBgQD3pahufZFdA47hEwmr0CqnwLhzXT2otNFo\ncit6rgdycEynCh2egq8Cj7cPoHmx1IRtiiNORetYb1A/6j6zDm3uXo+4Mxb13Ipe\ncgXMmLBkZurA4iNdq8wOSjHLj27IWfoG3hhmTQ2SJVRdi4bhkfWrDmAPtZ9otKgZ\nlwQ/A2+gwQKBgADNop4hnVxv6Hlyu6UKFsf8sOjrLH586yOENXG5LzsPrtr4y3Qo\nJgF/YlHHc0pKzj+sOlCRzw44ox4sSJ6RmNCQjbXAgec0+fV1/K0Fe+XVkrUYuD47\n7aYXu5CsFJcoOOTC80Sz2soHdrITsfJ+Yiz+KyxQW5uDE5buPOOZ/2ZhAoGBALdF\nxMnIaeyxNmtBgJXDn924FYljBr+02Yj3fU/0PRSnIUM5jEQDqOs3Wp3ZAFbn1P2Q\nDqLdwdcXwgcbHz26Pwb6ulfyj1py1YAh2ELa+SfEtpT6hnvLKV+l7wYb5zukwxGU\nCfCjs5hlwfLc0HxdXbczE0ps+kUt9X3CsmTD8TfBAoGBAJWU+HjJgSAOQBBy7Akw\nYY0sFrRoGlzZHFudLSloarH8csMVxWmLsz4CET6lMRmJbYipEQd5FKxhkfXJvcEn\nTc7x0+5fyAe3zBW4NgchxjWHFLjCNFX+gy4hZFpCbgSg/5EOgNzfKexqgcZR+nzv\nVjcQAU5jOlcZ6MFpDJJNK30k\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-zvjmp@marten-application.iam.gserviceaccount.com",
"client_id": "100533957773437883097",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-zvjmp%40marten-application.iam.gserviceaccount.com"
}