Skip to content

Commit

Permalink
remove unsplash code from rcs
Browse files Browse the repository at this point in the history
closes MAT-1188
flag=none

test plan:
- jenkins passes
- canvas and the rcs still runs
- any uploading an image behavior works as normal

Change-Id: I4a2932712b1f7170ddf995cffb659816266b368d
Reviewed-on: https://gerrit.instructure.com/c/canvas-rce-api/+/310258
Tested-by: Service Cloud Jenkins <[email protected]>
Reviewed-by: Jacob DeWar <[email protected]>
QA-Review: Jacob DeWar <[email protected]>
Product-Review: Sarah Gerard <[email protected]>
  • Loading branch information
sarah-gerard committed Feb 7, 2023
1 parent 9b7c82a commit 92596ca
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 344 deletions.
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@ CIPHER_PASSWORD=TEMP_PASSWORD
ECOSYSTEM_SECRET=astringthatisactually32byteslong
ECOSYSTEM_KEY=astringthatisactually32byteslong
FLICKR_API_KEY=fake_key
UNSPLASH_APP_NAME=canvas-rce-api-dev
UNSPLASH_APP_ID=fake_app_id
UNSPLASH_SECRET=fake_secret
YOUTUBE_API_KEY=fake_key
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

remove unsplash code

## [1.24]

Fix malformed URI error for search
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ docker run \
-e ECOSYSTEM_KEY \
-e ECOSYSTEM_SECRET \
-e FLICKR_API_KEY \
-e UNSPLASH_APP_ID \
-e UNSPLASH_SECRET \
-e UNSPLASH_APP_NAME \
-e YOUTUBE_API_KEY \
-e STATSD_PORT=8125 \
-e STATSD_HOST=127.0.0.1 \
Expand All @@ -68,9 +65,6 @@ Configuration options are set via the following environment variables:
- `ECOSYSTEM_KEY`: _Required_ The encryption secret shared with Canvas.
- `ECOSYSTEM_SECRET`: _Required_ The signing secret shared with Canvas.
- `FLICKR_API_KEY`: Required to support Flickr image search.
- `UNSPLASH_APP_ID`: Required to support [Unsplash](https://unsplash.com) image search.
- `UNSPLASH_SECRET`: Required to support [Unsplash](https://unsplash.com) image search.
- `UNSPLASH_APP_NAME`: Required to support [Unsplash](https://unsplash.com) image search.
- `YOUTUBE_API_KEY`: Required for querying titles of YouTube embeds.
- `NODE_ENV`: This should always be set to `production` when running in
production.
Expand Down
3 changes: 1 addition & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use strict";

require("dotenv").config();
// unsplash-js requires fetch to be available in the global scope
// see: https://github.com/unsplash/unsplash-js#adding-polyfills

global.fetch = require("node-fetch");

const container = require("./app/container");
Expand Down
18 changes: 3 additions & 15 deletions app/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const { actionKeyMiddleware: statsdKey } = require("../middleware/stats");
const _auth = require("../middleware/auth");
const wrapCanvas = require("./wrapCanvas");
const flickrSearch = require("./flickrSearch");
const UnsplashController = require("./unsplash");
const getSessionHandler = require("./session");
const announcements = require("./announcements");
const assignments = require("./assignments");
Expand All @@ -26,10 +25,10 @@ const youTubeTitle = require("./youTubeApi");
const documents = require("./documents");

function inject() {
return [_auth, UnsplashController];
return [_auth];
}

function init(auth, unsplashController) {
function init(auth) {
return {
applyToApp(app) {
app.get(
Expand Down Expand Up @@ -123,18 +122,7 @@ function init(auth, unsplashController) {
auth,
flickrSearch
);
app.get(
"/api/unsplash/search",
statsdKey("api", "unsplash_search"),
auth,
unsplashController.search.bind(unsplashController)
);
app.get(
"/api/unsplash/pingback",
statsdKey("api", "unsplash_pingback"),
auth,
unsplashController.pingback.bind(unsplashController)
);

app.get(
"/api/session",
statsdKey("api", "session"),
Expand Down
98 changes: 0 additions & 98 deletions app/api/unsplash.js

This file was deleted.

17 changes: 0 additions & 17 deletions app/services/unsplash.js

This file was deleted.

25 changes: 1 addition & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@
"parse-link-header": "0.4.1",
"qs": "^6.2.1",
"querystring": "0.2.0",
"raven": "github:zwily/raven-node#middleware-req-callback",
"unsplash-js": "^6.3.0"
"raven": "github:zwily/raven-node#middleware-req-callback"
},
"devDependencies": {
"cross-env": "^3.1.3",
Expand Down
Loading

0 comments on commit 92596ca

Please sign in to comment.