├── public ├── robots.txt ├── favicon.png ├── logo192.png ├── logo512.png ├── manifest.json └── index.html ├── renovate.json ├── src ├── setupTests.js ├── App.test.js ├── index.js ├── index.css ├── App.js ├── App.css └── logo.svg ├── README.md ├── package.json ├── api └── data.js └── .gitignore /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descope-sample-apps/descope-escape-room/HEAD/public/favicon.png -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descope-sample-apps/descope-escape-room/HEAD/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descope-sample-apps/descope-escape-room/HEAD/public/logo512.png -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "local>descope-sample-apps/renovate-config" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | 6 | const root = ReactDOM.createRoot(document.getElementById('root')); 7 | root.render( 8 | 9 | 10 | 11 | ); 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to Descope Escape Room / CODEEPS 2 | 3 | To solve the escape room mystery - clone this repo locally (do not fork), and make the app work. Share the solution with `escape-room [at] descope [dot] com`. 4 | 5 | We want to keep it interesting for you and the other players, so please do not fork this repo, or create PR with the solution... 6 | 7 | Read more at https://descope-escape-room.com 8 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 3 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 4 | sans-serif; 5 | -webkit-font-smoothing: antialiased; 6 | -moz-osx-font-smoothing: grayscale; 7 | } 8 | 9 | code { 10 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 11 | monospace; 12 | } 13 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | 3 | function App() { 4 | const [data, setData] = useState([]); 5 | 6 | useEffect(() => { 7 | fetch("https://descope-escape-room.com/api/data", { 8 | method: "POST", 9 | headers: { 10 | Accept: "application/json, text/plain, */*", 11 | "Content-Type": "application/json", 12 | }, 13 | }) 14 | .then((response) => response.json()) 15 | .then((resJson) => { 16 | setData(resJson); 17 | console.log(resJson); 18 | // data = resJson 19 | }); 20 | }, []); 21 | 22 | return ( 23 |
24 |
25 | {data.body} 26 |
27 | ); 28 | } 29 | 30 | export default App; 31 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.16.5", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "react": "^18.2.0", 10 | "react-dom": "^18.2.0", 11 | "react-scripts": "5.0.1", 12 | "web-vitals": "^2.1.4" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /api/data.js: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // This file is a copy of the escape room hosted server. 4 | // It is provided here so you can understand returned errors. 5 | // Good luck! 6 | // 7 | // 8 | 9 | /* 10 | 11 | ... 12 | 13 | if (request.method === 'POST' || request.method === 'GET') { 14 | const projectId = request.headers['x-project-id']; 15 | if (!projectId) { 16 | response.status(200).json({ 17 | body: "Error ERR001" 18 | }); 19 | return 20 | } 21 | const descopeClient = DescopeClient({projectId: projectId}); 22 | 23 | const header = request.headers['authorization']; 24 | if (!header) { 25 | response.status(200).json({ 26 | body: "Error ERR002" 27 | }); 28 | return; 29 | } 30 | 31 | const session_token = header?.split(" ")[1] ?? ""; 32 | if (!session_token) { 33 | response.status(200).json({ 34 | body: "Error ERR003" 35 | }); 36 | return; 37 | } 38 | 39 | let jwt = ""; 40 | try { 41 | jwt = await descopeClient.validateJwt(session_token); 42 | } 43 | catch (ex) { 44 | response.status(200).json({ 45 | body: "Error ERR004" 46 | }); 47 | } 48 | 49 | if (jwt.token.escape !== "room") { 50 | response.status(200).json({ 51 | body: "Error ERR005" 52 | }); 53 | return; 54 | } 55 | 56 | if (!jwt.token.permissions || jwt.token.permissions.indexOf('player') === -1) { 57 | response.status(200).json({ 58 | body: "Error ERR006" 59 | }); 60 | return; 61 | } 62 | 63 | response.status(200).json({ 64 | body: process.env.REACT_APP_GLORIOUS_LOCATION 65 | }); 66 | 67 | ... 68 | 69 | */ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CODEEPS 5 | 6 | 7 | 51 | 52 | 53 |
54 |

CODEEPS CONFIDENTIAL

55 |
56 |
57 |

58 | We are Codeeps - a global secret organization that operates behind the scenes to maintain 59 | global stability and security. We have been around for centuries, working in secrecy to 60 | protect the world from threats both foreign and domestic. 61 |

62 |
63 |
64 | 65 | VGhpcyBjb2RlIG1lYW5zIG5vdGhpbmcuIElmIHlvdSBuZWVkIGEgaGludCwgc2VuZCBhIHJlcXVlc3QgdG8gZXNjYXBlLXJvb21AZGVzY29wZS5jb20= 66 | 67 | 68 |

69 | This is Glorious. My next message is hidden in our server which is accessible only with 70 | the right authentication. I changed this website so it can access my message, but didn't 71 | finish it. It is available on 72 | GitHub, and it is up to you to make it work. 78 |

79 |

80 | All I can say is that you'll need to add Descope Flows to it somehow, and everything you 81 | need to do so is at 82 | https://docs.descope.com 85 |

86 |

Good luck!

87 |
88 |

BEGIN MESSAGE

89 |
90 |

END MESSAGE

91 | 92 | 93 | VGhpcyBjb2RlIG1lYW5zIG5vdGhpbmcuIElmIHlvdSBuZWVkIGEgaGludCwgc2VuZCBhIHJlcXVlc3QgdG8gZXNjYXBlLXJvb21AZGVzY29wZS5jb20= 94 | 95 |
96 | 97 | 100 | 101 | 102 | --------------------------------------------------------------------------------