0.1.1 • Published 2 years ago

home-portal-services-1 v0.1.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Welcome to your CDK TypeScript project!

Getting Started

To get a local copy up and running follow these not so simple steps.

Prerequisites

  • npm
npm install npm@latest -g
  • AWS Sam cli

Installation for WINDOWS

  • Configure IAM permissions and AWS credentials.
  • Install Docker. Docker is a prerequisite only for testing your application locally. Install Docker
  • Install the AWS SAM CLI 64-bit

Installation for MacOS

  • Configure IAM permissions and AWS credentials.
  • Install Docker. Docker is a prerequisite only for testing your application locally. Install Docker
  • Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • Install the AWS SAM CLI
brew tap aws/tap
brew install aws-sam-cli

Project Dependencies

yarn install

Usage

sh startlocal.sh

Custom sandbox deployments (testing in the cloud)

To connect and deploy directly from the Sandbox AWS account follow the instructions at:

https://fctg-pme.atlassian.net/l/c/MRZFxS7s Perform the following steps to deploy a Stack to the sandbox account:

  • Authenticate with saml2aws (see above)
  • run: yarn ci:build
  • run: cdk deploy -c stage=GITHUB_HANDLE --profile sandbox --all -- note: In this example I've used my github handle as the "stage" context, so that'll have my own cloudformation stack to test against. Domain related cloud resources are only created once if the "stage" context matches a predefined list of hosts (See: HomePortalSharedStack). Remember to cdk destroy when you are finished.

Postman setup

APIs are protected with OAuth. To test it you need to user OAuth2.0 Authorization in postman and request access_token.

The following parameters are used to request access token in postman. Go to your 'authorization tab', select OAuth 2.0 as your authorization type and enter the following.

Dev Env

| Header Prefix: Bearer
| Token Name: HomeAppOktaDev
| Grant Type: Implicit
| Callback URL: https://home-internals-web-dev.retailsolutions.dev/implicit/callback
| Auth URL: https://flightcentre.oktapreview.com/oauth2/default/v1/authorize?nonce=g5ly497e8ps
| Client ID: 0oa12vk3g8xMoFMkI0h8
| Scope: openid profile
| State: thisisastate (can be anything you like)
| Client Authentication: choose "Send as Basic Auth header"

Then click the 'Get New Access Token' button, click 'Proceed' in the popup, and 'Use Token'. You should then be able send your request.