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

Melody by Me and File Privacy Management

Melody by Me and File Privacy Management

LINE Developers Thailand

October 16, 2021
Tweet

More Decks by LINE Developers Thailand

Other Decks in Technology

Transcript

  1. MELODY BY ME AND


    FILE PRIVACY MANAGEMENT

    View full-size slide

  2. • LINE MELODY and Melody by Me


    • Files management overview


    • File privacy with presigned url


    • Want to make it more secure?
    AGENDA

    View full-size slide

  3. มี
    user
    กี ่
    คนแ
    ล้
    ว, 1505636 (22/07/21)
    1.5M


    LINE Melody Users

    View full-size slide

  4. มี
    user
    กี ่
    คนแ
    ล้
    ว, 1505636 (22/07/21)
    30K


    LINE Melody Musics

    View full-size slide

  5. MELODY BY ME

    View full-size slide

  6. MELODY FILE
    MANAGEMENT
    OVERVIEW

    View full-size slide

  7. File Types by Usage
    ● Real File


    ● Ringtone


    ● Ringback tone
    ● Preview File

    View full-size slide

  8. Cloud Service Platform

    View full-size slide

  9. Verda Object Storage - VOS
    Bucket
    Object

    View full-size slide

  10. Music
    Normal melody

    View full-size slide

  11. Music
    ADMIN WEB
    MELODY WEB
    PREVIEW
    FOLDER
    REAL FILES
    FOLDER
    RT/RBT SETTING
    SERVICE

    View full-size slide

  12. Music
    PREVIEW FOLDER
    REAL FILE FOLDER
    Private
    Public

    View full-size slide

  13. Music
    ADMIN WEB
    MELODY WEB
    PREVIEW
    FOLDER
    REAL FILES
    FOLDER
    RT/RBT SETTING
    SERVICE

    View full-size slide

  14. มี
    user
    กี ่
    คนแ
    ล้
    ว, 1505636 (22/07/21)
    Voice
    Melody by me

    View full-size slide

  15. Voice
    MELODY WEB PRIVATE
    FOLDER
    RT/RBT SETTING
    SERVICE
    MELODY WEB

    View full-size slide

  16. FILES PRIVACY WITH
    PRESIGNED URL

    View full-size slide

  17. มี
    user
    กี ่
    คนแ
    ล้
    ว, 1505636 (22/07/21)
    Presigned url

    View full-size slide

  18. Voice
    PRIVATE
    DIRECTORY
    MELODY WEB
    RT/RBT SETTING
    SERVICE
    Generate
    PRESIGNED URL

    View full-size slide

  19. 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

    View full-size slide

  20. https://DOMAIN/private/folder_name/
    fi
    le_name.m4a?
    AWSAccessKeyId=S3_ACCESS_KEY&Signature=sNTwfp
    %2BEcf8kq32K464%2Bee1bO8Q%3D
    Presigned URL Example

    View full-size slide

  21. ● AWSAccessKeyId=S3_ACCESS_KEY
    ● Signature=sNTwfp%2BEcf8kq32K464%2Bee1bO8Q%3D
    Presigned URL Query String

    View full-size slide

  22. WANT TO MAKE IT
    MORE SECURE ?

    View full-size slide

  23. const params = {


    Bucket: ‘melody’,


    Key: ‘private/folder_name/
    fi
    le_name.m4a’,


    Expires: 60, // seconds


    };


    const previewUrl =


    client.getSignedUrl(‘getObject’, params);


    Set Expires

    View full-size slide

  24. https://DOMAIN/private/folder_name/
    fi
    le_name.m4a?
    AWSAccessKeyId=S3_ACCESS_KEY&Expires=16308416
    66&Signature=SL8XYVRoVLrB1xx2AaE28lQS18w%3D
    Set Expires

    View full-size slide

  25. ● AWSAccessKeyId=S3_ACCESS_KEY
    ● Signature=SL8XYVRoVLrB1xx2AaE28lQS18w%3D
    ● Expires=1630841666
    Set Expires

    View full-size slide

  26. Renew Keys
    Generate
    PRESIGNED URL
    NEW

    View full-size slide

  27. 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

    View full-size slide

  28. MELODY BY ME AND


    FILE PRIVACY MANAGEMENT

    View full-size slide

  29. https://melody.line.me/ https://melody.line.me/voice-record

    View full-size slide