Code Monkey home page Code Monkey logo

gcs-to-lr's Introduction

GCS to Lightroom Cloud Function

A Google Cloud Function that relays files uploaded to a Google Cloud Storage bucket to the Adobe Lightroom API to be imported into a user's catalog.

Setup

In lieu of a full OAuth integration at this point, the function relies on a number of variables stored as secrets in Secret Manager:

  • ADOBE_API_KEY - Api key for an Adobe OAuth Web App
  • ADOBE_CLIENT_ID - Client ID for the web app
  • ADOBE_CLIENT_SECRET - Client secret for the web app
  • ADOBE_ACCOUNT_ID - User's internal adobe account id (found by viewing an existing asset's .importSource.importedBy attribute in a user's catalog)
  • ADOBE_CATALOG_ID - User's internal catalog ID (found in the /rels/catalog link in the source code of a shared album)
  • ADOBE_ACCESS_TOKEN - A short-lived (24h) access token obtained using Adobe's OAuth 2.0 Playground

The access token needs to be input manually every 24 hours for this to work, until I get around to using the refresh token to extend access.

Note: Required scopes when generating an access token in the playground: openid,lr_partner_apis,lr_partner_rendition_apis,offline_access

Deploying

Run make deploy.

But first change any values such as your GCS bucket name and the location of secrets (which you could specify as env variables instead to simplify setup).

To Do

  • Handle errors in API responses
  • Add mechanism to update an access token from a given refresh token
    • And later, a multi-user solution for oauth
  • See if GCF gen2 is viable; initially the download speed from GCS was very slow when using gen2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.