Challenge Overview

This is another challenge in the series for Cloud Hub, where we are integrating with Okta SSO to populate app, user, and events data. We want to schedule a job to run daily and import any apps, users, and events (previous day). In the forum we will upload the current code, which now includes the seed data script in /seed. Any submissions can skip the seed setup and just focus on the script and updates listed below.

Script Flow

  1. Loop through all companies, any that have okta setup, we want to connect to the API and import data. The api info is stored in company.settings, see example in seed.js.
  2. Add any apps listed on /api/v1/apps to company.apps. Link the records using appName and name from the API. Store id to companyApps.settings.oktaId
  3. Add/Update any users, using /api/v1/users. Save id, email, firstName and lastName. If user is new to cloud hub, create them with a roleType of ‘user'.
  4. Add/Delete and user’s apps, using /api/v1/apps/{{appId}}/users.
  5. Import any events from the previous day where action.objectType = core.user_auth.login_success. Record should be stored in userStat,
    1. statType = “usage”,
    2. statValue = 1,
    3. timestamp = published value
    4. sourceId = eventId

 

Requirements

  1. API calls should make multiple calls to make sure all records are found. Most calls have limit=25 as default. The example account doesn’t have this many records, but should work when it does.
  2. Script is scheduled via cron job to run daily, and running it more than once per day, doesn’t create duplicate data.
  3. Any apps that aren’t found in Cloud Hub, are sent to an admin email address using SendGrid. This can be a raw text email, not looking for any design here, just a list of app names.

 

We are likely going to use AWS directly and not Heroku. You can ignore #2 on submission and just run video locallly. 



Final Submission Guidelines

  1. Any additions or modifications to the code project pass on "npm run lint" and "npm test".
  2. Deploy your solution to Heroku and make sure to include your working Heroku instance URL as part of your documentation.
  3. Provide your code and documentation in a single zip file. Make sure you include steps to deploy to Heroku.
  4. The bulk of your documentation should be in the Readme.md and you should assume that this will be open source so make sure you cover all the steps to set up,  If you have specific information that should not be included in a public readme (like your heroku link or links to your video) put them in a file called submission.txt and they will be omitted from the project if it is open sourced.
  5. Provide a quick video of your solution in action (feel free to annotate your video if you are not comfortable with spoken English or don’t like the sound of your own voice). Video may be private on youtube or added to the submission files.

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30053407