Created
April 21, 2020 07:47
-
-
Save vijayakumar-psg587/50ea5c0064732f6938898d87cbe98104 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Storage} from '@google-cloud/storage'; | |
import { AuthenticationModel } from '../models/authentication.model'; | |
import { AppUtilServiceInstance } from './app.util.service'; | |
import * as pino from 'pino'; | |
import { PinoLoggerServiceInstance } from './pino.logger.service'; | |
export class GcloudAuthentication { | |
private gcloudAuthModel: AuthenticationModel; | |
private LOGGER: pino.Logger; | |
constructor() { | |
this.gcloudAuthModel = AppUtilServiceInstance.getGcloudAuthModel(); | |
this.LOGGER = PinoLoggerServiceInstance.getLogger(__filename); | |
} | |
createGcloudAuthenticationBucket():Storage { | |
// @ts-ignore | |
console.log(this.gcloudAuthModel); | |
return new Storage({ | |
autoRetry: this.gcloudAuthModel.autoRetry, | |
keyFilename: this.gcloudAuthModel.keyFilename, | |
maxRetries: this.gcloudAuthModel.maxRetries, | |
projectId: this.gcloudAuthModel.projectId, | |
scopes: this.gcloudAuthModel.scope, | |
}); | |
}; | |
} | |
export const GcloudAuthenticationInstance = new GcloudAuthentication(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment