Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Melody by Me and File Privacy Management

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Melody by Me and File Privacy Management

LINE Developers Thailand

October 16, 2021

Transcript

33 slides
  1. • LINE MELODY and Melody by Me • Files management

    overview • File privacy with presigned url • Want to make it more secure? AGENDA
  2. import { S3 } from ‘aws-sdk’; const s3Con fi g

    = { endpoint: ‘HOST’, accessKeyId: ‘ACCESS_KEY’, secretAccessKey: ‘SECRET_KEY’, }; const client = new S3(s3Con fi g); const params = { Bucket: ‘melody’, Key: ‘private/folder_name/ fi le_name.m4a’, }; const previewUrl = client.getSignedUrl(‘getObject’, params); Presigned URL Implementation
  3. const params = { Bucket: ‘melody’, Key: ‘private/folder_name/ fi le_name.m4a’,

    Expires: 60, // seconds }; const previewUrl = client.getSignedUrl(‘getObject’, params); Set Expires
  4. import { S3 } from ‘aws-sdk’; const s3Con fi g

    = { endpoint: ‘HOST’, accessKeyId: env.S3_ACCESS_KEY, secretAccessKey: env.S3_SECRET_KEY, }; const client = new S3(s3Con fi g); Rotate Keys

More Decks by LINE Developers Thailand

Other Decks in Technology