Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef 1493 - OCID Integration #7909

Merged

Conversation

ayush-billore
Copy link
Collaborator

@ayush-billore ayush-billore commented May 24, 2023

EPIC - Supermarket and Chef manage integration with Automate HA

What Changed?

OCID(Oauth Provider utility for Chef Infra) is integrated with Automate


Why?

So that different apps e.g. Supermarket and Chef Manage can work with Automate and Automate HA


DEV Documentation and Demo Links


Customer Facing Documentation (In Progress)


Testing Checklist


All PRs must tick these:

With occasional exceptions, all PRs from Progress employees must tick these:

  • Is the code clear? (complicated code or lots of comments--subdivide and use well-named methods, meaningful variable names, etc.)
  • Consistency checked? (user notifications, user prompts, visual patterns, code patterns, variable names)
  • Repeated code blocks eliminated? (adapt and reuse existing components, blocks, functions, etc.)
  • Spelling, grammar, typos checked? (at a minimum use make spell in any component directory)
  • Code well-formatted? (indents, line breaks, etc. improve rather than hinder readability)

All PRs from Progress employees should tick these if appropriate:

  • Tests added/updated? (all new code needs new tests)
  • Docs added/updated? (all customer-facing changes)

Please add a note next to any checkbox above if you are NOT ticking it.

📷 Screenshots, if applicable

@netlify
Copy link

netlify bot commented May 24, 2023

Deploy Preview for chef-automate ready!

Name Link
🔨 Latest commit 70a4206
🔍 Latest deploy log https://app.netlify.com/sites/chef-automate/deploys/64b9807f540299000886e00f
😎 Deploy Preview https://deploy-preview-7909--chef-automate.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ayush-billore ayush-billore force-pushed the chef-1493/supermarket-and-chef-manage-integration-with-automate-HA branch from fae6b90 to 488cd93 Compare May 30, 2023 09:02
@sonarqube-for-infrastructure-prod

SonarQube Quality Gate

Quality Gate failed

Failed condition 15.6% 15.6% Coverage on New Code (is less than 80%)

See analysis details on SonarQube

@ayush-billore ayush-billore changed the title [DRAFT] Chef 1493/ OCID Integration Chef 1493 - OCID Integration Jun 26, 2023
@ayush-billore ayush-billore marked this pull request as ready for review June 26, 2023 07:33
@vivek-yadav vivek-yadav force-pushed the chef-1493/supermarket-and-chef-manage-integration-with-automate-HA branch from c7ec679 to 9f62839 Compare July 20, 2023 17:37
ayush-billore and others added 21 commits July 21, 2023 00:13
* add ocid to .bldr.toml

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add ocid component

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add configuration related changes related to ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add ocid api config

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* update deployment api config

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add ocid config details to automate-deployment component

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add ocid in the pg_ident.conf

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add config for ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add ocid specific nginx config

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add config files in ocid component

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* refactored run hook

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* remove unwanted code from plan.sh of ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* remove unwanted files

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* remove ocid related changes from ctl.go

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* - move database url variable to default.toml
- move database related task from plan.sh to run hook

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* - remove unnecessary code from package.meta
- updated permission for schema.rb and /tmp as these files will be u from run hook
- add autogenerated gen.go

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add a comment for tmp folder and make them into a single line

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* Fix health check for oc-id component (#7869)

Signed-off-by: ayush-billore <ayush.billore@progress.com>

---------

Signed-off-by: ayush-billore <ayush.billore@progress.com>
Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
Signed-off-by: ayush-billore <ayush.billore@progress.com>
* setting environment configuration from the run hook of ocid component

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

* added configuration for chef-server for ocid

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

* reading values from environment instead of arguments for setting webui key

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

* added check of presence of webui_key in erchef before setting the value in ocid

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

---------

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
* remove thin and add unicorn in ocid runhook

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* nginx configuration for ocid in cs-nginx

* automate-load-balancer configuration for ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* unexpose port 9090

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* pick port from toml file

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* fix nesting in default.toml of ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* fix health check of automate cs ocid use http instead of https

Signed-off-by: ayush-billore <ayush.billore@progress.com>

---------

Signed-off-by: ayush-billore <ayush.billore@progress.com>
…ive (#7912)

* Implemented register OCID application and show registered OCID applications

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

registered oauth application details file generation code improvement

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

registering ocid applications in a transaction

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

register multiple ocid application (#7911)

* register multiple OCID application in one shot

* temp implementation of multiple ocid app registration

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

* review feedback

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

---------

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

made app update statement conditional if there is a change in the redirect uri

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

code cleanup

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

code review changes

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

* added dev comments

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

---------

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
Signed-off-by: saghoshprogress <saghosh@progress.com>
* fix rewrite vlnerability to reach ocid from automate load balancer

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* fix gen.go after running deployment_generate

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* remove extra space

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* fix route in nginx

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add ocid block in pipeline

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* fix ocid test cases path

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* fix permission issue in oc-id verify pipeline

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* - move config logic from plan.sh to run hook
- run run-hook as root
-

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* temporary commenting for testing build

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add test case for checking webui key

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* move testing_ocid file from expeditor to integration tests

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* removing hardcoded url and using template for pg url setup

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add more pg_helper in run hook

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add test case to check env configurations

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* remote erlang code and DATABASE_URL hard coded string

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add a todo for removal for further verificatgion of build_line block and remove chmod as the file will be run as Root user

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* Revert "temporary commenting for testing build"

This reverts commit d855558.

* update test case - test_if_env_vars_are_configured

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* use os instead of deprecated ioutil

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add test function in testing_ocid.sh

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* rearrange run hook code

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* dump logs in pipeline Temporarily

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* added default attribute for ocid app registration in default.toml file

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

* update value of package scaffolding for ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* remove temporarily added logging function

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* added support for oc-id-show-app command in automate HA bastion node

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

* add user login test cases and fix other config test cases in chef-server-collection

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* update chef-server-collection test cases for ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add install_if_missing method

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* trying to make test case lean

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* remove root user creation logic from run hook of ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* create data before doing the login call

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* resolve review comments

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* Set studio env for testing ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* move logic from do_install.sh to run hook of ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* update error messages in ocid test functions

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* uncomment install_if_missing method in testing-ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* remove source logic from verify_private pipeline

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* linting fix

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

---------

Signed-off-by: ayush-billore <ayush.billore@progress.com>
Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
Co-authored-by: RajeshPaul38 <rajesh.paul@progress.com>
* add ocid integration tests for checking config patch

Signed-off-by: ayush-billore <ayush.billore@progress.com>

# Conflicts:
#	.studio/chef-server-collection

* add oauth app registration test case

Signed-off-by: ayush-billore <ayush.billore@progress.com>

# Conflicts:
#	.studio/chef-server-collection

* fix the typo

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* uncomment testing_ocid block

Signed-off-by: ayush-billore <ayush.billore@progress.com>

---------

Signed-off-by: ayush-billore <ayush.billore@progress.com>
Signed-off-by: ayush-billore <ayush.billore@progress.com>
Signed-off-by: ayush-billore <ayush.billore@progress.com>
* update config_request values by taking reference from erchef component

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* remove unwanted variables from api config of ocid

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* removed redundant toml file

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

---------

Signed-off-by: ayush-billore <ayush.billore@progress.com>
Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
Co-authored-by: RajeshPaul38 <rajesh.paul@progress.com>
* Generate secret_key_base for OCID rails app

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

file renamed

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

added provision for user to provide the secret_key_base for OCID rails application

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

doing a tidy up of the generated secret_key_base to remove all invalid characters

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

* code review changes

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

---------

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
* add validation logic for ocid redirect uri

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add confition to check presence of name and redirect uri

Signed-off-by: ayush-billore <ayush.billore@progress.com>

---------

Signed-off-by: ayush-billore <ayush.billore@progress.com>
* removed unnecessary flags from oc-id-show-app for automate HA

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

* linting

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>

---------

Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
* update port of ocid from 9090 to 10114

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* fix indentation with gofmt

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* generate bldr.toml dynamically by running bldr-config-gen/main.go

Signed-off-by: ayush-billore <ayush.billore@progress.com>

---------

Signed-off-by: ayush-billore <ayush.billore@progress.com>
* auto generate bldr.toml

Signed-off-by: ayush-billore <ayush.billore@progress.com>

* add quotes to fix repo health pipeline

Signed-off-by: ayush-billore <ayush.billore@progress.com>

---------

Signed-off-by: ayush-billore <ayush.billore@progress.com>
Signed-off-by: ayush-billore <ayush.billore@progress.com>
Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
Signed-off-by: RajeshPaul38 <rajesh.paul@progress.com>
@vivek-yadav vivek-yadav force-pushed the chef-1493/supermarket-and-chef-manage-integration-with-automate-HA branch from 9f62839 to 70a4206 Compare July 20, 2023 18:44
@sonarqube-for-infrastructure-prod

SonarQube Quality Gate

Quality Gate failed

Failed condition 15.2% 15.2% Coverage on New Code (is less than 80%)

See analysis details on SonarQube

@kalroy kalroy merged commit de9aed4 into main Jul 21, 2023
5 of 6 checks passed
@kalroy kalroy deleted the chef-1493/supermarket-and-chef-manage-integration-with-automate-HA branch July 21, 2023 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add_release_notes documentation Anything related to the Automate docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants