Challenge Overview

Background 

Topcoder is considering to refactor the TC Direct application by using RESTful APIs instead of calling various EJBs and directly contacting the underline database, which will allow us to begin decoupling TC Direct from its existing backend and provide exposure to some of its core services. As a first step, we want to avoid rewriting some of the complex business logic.

For the initial stage, we'd like to use AWS Lambda Function and AWS API Gateway to wrap around the EJB calls and database calls, and make the TC Direct to call the AWS API gateway instead.  This way we isolate the depenencies between TC Direct and EJB services/informix, then we can move ahead quickly.

Scope

Previously in we have launched severeal challenges like Proof Of Concept - AWS Lambda Function to Invoke Direct EJB Service etc, and sorted out the way to use AWS Lambda Function to wrap arround the EJB calls and  Database calls.

For this challenge, we'd like to follow the same approach to create AWS Lambda Function for adding billing account for project. 

Requirements

1. We'd like to mimic the similar logic in Topcoder Direct, see 

com.topcoder.direct.services.view.action.project.edit.SaveCockpitProjectSettingAction#associateProjectBillingAccount() function.

2. Proper error message should be returned like

  • The project does not exist
  • User don't have permission to access the billing account
  • The billing account does not exist
  • any other problems.

3.  Instead of passing the userId as the previous submissions, we'd like to accept a JWT token be passed when calling the lambda function. and inside the lambda function, it will verify and get the userid instead.

similar logic can be found  by

com.topcoder.direct.services.view.interceptors.AuthenticationInterceptor

Please make this modulized in a single utlity class, so we can easily reuse in other aws lambda functions.

4. After successfully add the billing acount, it needs to update the fixed bug race contest fee and percentage bug race contest fee for TC direct project based on the contest fee settings of the corresponding billing account.

4. Please create the swagger api doc for the created aws lambda functions, please following the example provided in forum.

5. Please use AWS lambda swagger https://github.com/awslabs/aws-apigateway-importer to create api gateway endpoint using the created swagger api doc, and hook it with the aws lambda function

6. The json response should be simple and clear, and properly handle the error cases with proper messages.

Reference

1. Competitors need to request your own VM for development and testing.

2. For testing,  you can directly create project in Topcoder Direct, see EditProject page for the current associating billing account functionality.

3. You can visit http://<<vm-ip>>:8580/ to find the JNDI lookup name for remote EJB calls.

4. Please reuse any components in TC Direct instead of creating your own if possible. 

5. The previous challenges will be provided in forum for reference.

VM ENVIRONMENT

If you need a Topcoder VM to work on this challenge, Please request the VM in the challenge forum.

Information about VM can be found below:

VM specific information is found here: http://www.topcoder.com/wiki/display/docs/VM+Image+2.5

Upon registration as a submitter or reviewer you will need to request a VM based on the new TopCoder Cockpit/Direct image. To request your image, please use the forum. Before requesting your VM, you need to ensure that you have an SSH key created and in your member profile. Instructions to do so are here: http://www.topcoder.com/wiki/display/projects/Generate+SSH+Key, and instructions to connect afterwards are here:http://www.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key.



Final Submission Guidelines

  • Complete source code for aws lambda function
  • Working VM and aws lambda function for testing
  • Deployment Guide and Verification Documentation

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30053809