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

Add license interceptor in automate gateway (#8439) #8452

Merged
merged 39 commits into from
Jul 19, 2024
Merged

Conversation

YashviJain01
Copy link
Collaborator

  • Adding the intercerptors with error only for license

  • Removing the function, will create another PR for this

  • Removing interface, will create another PR for this

  • Adding the function for interceptor

  • Adding interceptor layer for license

  • Adding allow api list if the license needs to be applied from backend

  • Adding license apply

  • Adding license function in default deploy

  • Removing unwanted loggers

  • Adding license apply command in pipelines, and adding create token api in api allow list

  • Applying license at various location to unblock the pipeline

  • Adding changes

  • Adding Applying license in do_dploy for chef server

  • updating the temp license

  • Adding A2_license as a variable from vault

  • Adding A2_license as a environment variable

  • Adding A2 license in the pipeline

  • Adding license in studio pipelines

  • Adding license data

  • Adding license data

  • Adding license data

  • Adding license

  • Adding licrnse in dev from command

  • Adding license from vault and applying it

  • Adding license in gateway intergation

  • Adding license in gateway intergation

  • Adding license key in the pipeline

  • Adding license after upgrade

  • commenting jq line for print


🔩 Description: What code changed, and why?

⛓️ Related Resources

👍 Definition of Done

👟 How to Build and Test the Change

✅ 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

Copy link

netlify bot commented May 20, 2024

👷 Deploy Preview for chef-automate processing.

Name Link
🔨 Latest commit 883f1a1
🔍 Latest deploy log https://app.netlify.com/sites/chef-automate/deploys/669a61911f1b8a0008abd233

@github-actions github-actions bot added the documentation Anything related to the Automate docs. label Jun 5, 2024

SonarQube Quality Gate

Quality Gate failed

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

See analysis details on SonarQube

@daveaugustus daveaugustus force-pushed the feature/CHEF-11824 branch 2 times, most recently from 9f69330 to 7a57dfd Compare July 17, 2024 11:51
YashviJain01 and others added 22 commits July 18, 2024 16:28
* Adding the intercerptors with error only for license

Signed-off-by: Yashvi Jain <[email protected]>

* Removing the function, will create another PR for this

Signed-off-by: Yashvi Jain <[email protected]>

* Removing interface, will create another PR for this

Signed-off-by: Yashvi Jain <[email protected]>

* Adding the function for interceptor

Signed-off-by: Yashvi Jain <[email protected]>

* Adding interceptor layer for license

Signed-off-by: Yashvi Jain <[email protected]>

* Adding allow api list if the license needs to be applied from backend

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license apply

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license function in default deploy

Signed-off-by: Yashvi Jain <[email protected]>

* Removing unwanted loggers

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license apply command in pipelines, and adding create token api in api allow list

Signed-off-by: Yashvi Jain <[email protected]>

* Applying license at various location to unblock the pipeline

Signed-off-by: Yashvi Jain <[email protected]>

* Adding changes

Signed-off-by: Yashvi Jain <[email protected]>

* Adding Applying license in do_dploy for chef server

Signed-off-by: Yashvi Jain <[email protected]>

* updating the temp license

Signed-off-by: Durga Sarat Chandra Maddu <[email protected]>

* Adding A2_license as a variable from vault

Signed-off-by: Yashvi Jain <[email protected]>

* Adding A2_license as a environment variable

Signed-off-by: Yashvi Jain <[email protected]>

* Adding A2 license in the pipeline

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license in studio pipelines

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license data

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license data

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license data

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license

Signed-off-by: Yashvi Jain <[email protected]>

* Adding licrnse in dev from command

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license from vault and applying it

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license in gateway intergation

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license in gateway intergation

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license key in the pipeline

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license after upgrade

Signed-off-by: Yashvi Jain <[email protected]>

* commenting jq line for print

Signed-off-by: Yashvi Jain <[email protected]>

---------

Signed-off-by: Yashvi Jain <[email protected]>
Signed-off-by: Durga Sarat Chandra Maddu <[email protected]>
Co-authored-by: Yashvi Jain <[email protected]>
Co-authored-by: dmaddu <[email protected]>
* Infrastructure node cli license changes

Signed-off-by: Yashvi Jain <[email protected]>

* Adding test cases for pre functions

Signed-off-by: Yashvi Jain <[email protected]>

* Adding correct message in case of failure

Signed-off-by: Yashvi Jain <[email protected]>

---------

Signed-off-by: Yashvi Jain <[email protected]>
Co-authored-by: Yashvi Jain <[email protected]>
* adding grace period to the license status1

Signed-off-by: swatign <[email protected]>

* checking for grace period value in status responce

Signed-off-by: swatign <[email protected]>

* adding grace period in gateway file

Signed-off-by: swatign <[email protected]>

* added grace period in gateway

Signed-off-by: swatign <[email protected]>

* Adding correct pb.go files

Signed-off-by: Yashvi Jain <[email protected]>

* removed log statements

Signed-off-by: swatign <[email protected]>

* Helper.go file for warning message (#8464)

* Helper.go function added

Signed-off-by: karan parmar <[email protected]>

* hook added for airgap file

Signed-off-by: karan parmar <[email protected]>

* seperate function added

Signed-off-by: karan parmar <[email protected]>

* Adding helper functions correctly

Signed-off-by: Yashvi Jain <[email protected]>

* cli changes

Signed-off-by: Aishwarya Aishwarya <[email protected]>

* cli changes 2

Signed-off-by: swatign <[email protected]>

* Prefetch commands added

Signed-off-by: karan parmar <[email protected]>

* Adding new statements for cli

Signed-off-by: Yashvi Jain <[email protected]>

* Adding the license itercepter valid grace period of 60

Signed-off-by: Yashvi Jain <[email protected]>

* latest changes done

Signed-off-by: karan parmar <[email protected]>

* final changes 1

Signed-off-by: karan parmar <[email protected]>

* final changes 2

Signed-off-by: karan parmar <[email protected]>

* final changes 3

Signed-off-by: karan parmar <[email protected]>

* final changes 4

Signed-off-by: karan parmar <[email protected]>

---------

Signed-off-by: karan parmar <[email protected]>
Signed-off-by: Yashvi Jain <[email protected]>
Signed-off-by: Aishwarya Aishwarya <[email protected]>
Signed-off-by: swatign <[email protected]>
Co-authored-by: Yashvi Jain <[email protected]>
Co-authored-by: Aishwarya Aishwarya <[email protected]>
Co-authored-by: swatign <[email protected]>

* added license type in api responce and corrected license control service file

Signed-off-by: swatign <[email protected]>

---------

Signed-off-by: swatign <[email protected]>
Signed-off-by: Yashvi Jain <[email protected]>
Signed-off-by: karan parmar <[email protected]>
Signed-off-by: Aishwarya Aishwarya <[email protected]>
Co-authored-by: Yashvi Jain <[email protected]>
Co-authored-by: kparmar2000 <[email protected]>
Co-authored-by: Aishwarya Aishwarya <[email protected]>
* Chaged the func to tempfile

Signed-off-by: daveaugustus <[email protected]>

* Adding check for automate node for HA

Signed-off-by: daveaugustus <[email protected]>

* Adding check for automate node for HA

Signed-off-by: daveaugustus <[email protected]>

* added remote command

* cat file

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Removed json output

Signed-off-by: daveaugustus <[email protected]>

* changed pipeline commands

Signed-off-by: daveaugustus <[email protected]>

* removed func call for deploy cmds

Signed-off-by: Aishwarya Aishwarya <[email protected]>

* new code changes

Signed-off-by: Aishwarya Aishwarya <[email protected]>

* Added warning case function

Signed-off-by: daveaugustus <[email protected]>

* refactored

Signed-off-by: daveaugustus <[email protected]>

* reverted

Signed-off-by: daveaugustus <[email protected]>

* error corretcions

Signed-off-by: daveaugustus <[email protected]>

---------

Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: Aishwarya Aishwarya <[email protected]>
Co-authored-by: daveaugustus <[email protected]>
Co-authored-by: Aishwarya Aishwarya <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: “SanjuPal01” <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
daveaugustus and others added 6 commits July 19, 2024 11:58
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: Yashvi Jain <[email protected]>
Signed-off-by: Yashvi Jain <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
UTC
Signed-off-by: daveaugustus <[email protected]>
daveaugustus and others added 2 commits July 19, 2024 14:56
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: Durga Sarat Chandra Maddu <[email protected]>
@Dmaddu Dmaddu marked this pull request as ready for review July 19, 2024 12:26
daveaugustus added 2 commits July 19, 2024 18:03

Quality Gate failed Quality Gate failed

Failed conditions
6 New issues
26.6% Coverage on New Code (required ≥ 80%)
5.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@Dmaddu Dmaddu merged commit 56c5768 into main Jul 19, 2024
10 of 12 checks passed
@Dmaddu Dmaddu deleted the feature/CHEF-11824 branch July 19, 2024 18:10
kalroy pushed a commit that referenced this pull request Oct 8, 2024
* Add license interceptor in automate gateway (#8439)

* Adding the intercerptors with error only for license

Signed-off-by: Yashvi Jain <[email protected]>

* Removing the function, will create another PR for this

Signed-off-by: Yashvi Jain <[email protected]>

* Removing interface, will create another PR for this

Signed-off-by: Yashvi Jain <[email protected]>

* Adding the function for interceptor

Signed-off-by: Yashvi Jain <[email protected]>

* Adding interceptor layer for license

Signed-off-by: Yashvi Jain <[email protected]>

* Adding allow api list if the license needs to be applied from backend

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license apply

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license function in default deploy

Signed-off-by: Yashvi Jain <[email protected]>

* Removing unwanted loggers

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license apply command in pipelines, and adding create token api in api allow list

Signed-off-by: Yashvi Jain <[email protected]>

* Applying license at various location to unblock the pipeline

Signed-off-by: Yashvi Jain <[email protected]>

* Adding changes

Signed-off-by: Yashvi Jain <[email protected]>

* Adding Applying license in do_dploy for chef server

Signed-off-by: Yashvi Jain <[email protected]>

* updating the temp license

Signed-off-by: Durga Sarat Chandra Maddu <[email protected]>

* Adding A2_license as a variable from vault

Signed-off-by: Yashvi Jain <[email protected]>

* Adding A2_license as a environment variable

Signed-off-by: Yashvi Jain <[email protected]>

* Adding A2 license in the pipeline

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license in studio pipelines

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license data

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license data

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license data

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license

Signed-off-by: Yashvi Jain <[email protected]>

* Adding licrnse in dev from command

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license from vault and applying it

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license in gateway intergation

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license in gateway intergation

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license key in the pipeline

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license after upgrade

Signed-off-by: Yashvi Jain <[email protected]>

* commenting jq line for print

Signed-off-by: Yashvi Jain <[email protected]>

---------

Signed-off-by: Yashvi Jain <[email protected]>
Signed-off-by: Durga Sarat Chandra Maddu <[email protected]>
Co-authored-by: Yashvi Jain <[email protected]>
Co-authored-by: dmaddu <[email protected]>

* Infrastructure node cli license changes (#8449)

* Infrastructure node cli license changes

Signed-off-by: Yashvi Jain <[email protected]>

* Adding test cases for pre functions

Signed-off-by: Yashvi Jain <[email protected]>

* Adding correct message in case of failure

Signed-off-by: Yashvi Jain <[email protected]>

---------

Signed-off-by: Yashvi Jain <[email protected]>
Co-authored-by: Yashvi Jain <[email protected]>

* Adding Grace Period to the license status (#8460)

* adding grace period to the license status1

Signed-off-by: swatign <[email protected]>

* checking for grace period value in status responce

Signed-off-by: swatign <[email protected]>

* adding grace period in gateway file

Signed-off-by: swatign <[email protected]>

* added grace period in gateway

Signed-off-by: swatign <[email protected]>

* Adding correct pb.go files

Signed-off-by: Yashvi Jain <[email protected]>

* removed log statements

Signed-off-by: swatign <[email protected]>

* Helper.go file for warning message (#8464)

* Helper.go function added

Signed-off-by: karan parmar <[email protected]>

* hook added for airgap file

Signed-off-by: karan parmar <[email protected]>

* seperate function added

Signed-off-by: karan parmar <[email protected]>

* Adding helper functions correctly

Signed-off-by: Yashvi Jain <[email protected]>

* cli changes

Signed-off-by: Aishwarya Aishwarya <[email protected]>

* cli changes 2

Signed-off-by: swatign <[email protected]>

* Prefetch commands added

Signed-off-by: karan parmar <[email protected]>

* Adding new statements for cli

Signed-off-by: Yashvi Jain <[email protected]>

* Adding the license itercepter valid grace period of 60

Signed-off-by: Yashvi Jain <[email protected]>

* latest changes done

Signed-off-by: karan parmar <[email protected]>

* final changes 1

Signed-off-by: karan parmar <[email protected]>

* final changes 2

Signed-off-by: karan parmar <[email protected]>

* final changes 3

Signed-off-by: karan parmar <[email protected]>

* final changes 4

Signed-off-by: karan parmar <[email protected]>

---------

Signed-off-by: karan parmar <[email protected]>
Signed-off-by: Yashvi Jain <[email protected]>
Signed-off-by: Aishwarya Aishwarya <[email protected]>
Signed-off-by: swatign <[email protected]>
Co-authored-by: Yashvi Jain <[email protected]>
Co-authored-by: Aishwarya Aishwarya <[email protected]>
Co-authored-by: swatign <[email protected]>

* added license type in api responce and corrected license control service file

Signed-off-by: swatign <[email protected]>

---------

Signed-off-by: swatign <[email protected]>
Signed-off-by: Yashvi Jain <[email protected]>
Signed-off-by: karan parmar <[email protected]>
Signed-off-by: Aishwarya Aishwarya <[email protected]>
Co-authored-by: Yashvi Jain <[email protected]>
Co-authored-by: kparmar2000 <[email protected]>
Co-authored-by: Aishwarya Aishwarya <[email protected]>

* new changes as per docs

Signed-off-by: swatign <[email protected]>

* Check for automate node in HA (#8480)

* Chaged the func to tempfile

Signed-off-by: daveaugustus <[email protected]>

* Adding check for automate node for HA

Signed-off-by: daveaugustus <[email protected]>

* Adding check for automate node for HA

Signed-off-by: daveaugustus <[email protected]>

* added remote command

* cat file

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Added license status for HA

Signed-off-by: daveaugustus <[email protected]>

* Removed json output

Signed-off-by: daveaugustus <[email protected]>

* changed pipeline commands

Signed-off-by: daveaugustus <[email protected]>

* removed func call for deploy cmds

Signed-off-by: Aishwarya Aishwarya <[email protected]>

* new code changes

Signed-off-by: Aishwarya Aishwarya <[email protected]>

* Added warning case function

Signed-off-by: daveaugustus <[email protected]>

* refactored

Signed-off-by: daveaugustus <[email protected]>

* reverted

Signed-off-by: daveaugustus <[email protected]>

* error corretcions

Signed-off-by: daveaugustus <[email protected]>

---------

Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: Aishwarya Aishwarya <[email protected]>
Co-authored-by: daveaugustus <[email protected]>
Co-authored-by: Aishwarya Aishwarya <[email protected]>

* Pipeline check

Signed-off-by: daveaugustus <[email protected]>

* airgap upgrade pipeline

* Pipeline Fix

Signed-off-by: “SanjuPal01” <[email protected]>

* Adding the test cases correction

Signed-off-by: Yashvi Jain <[email protected]>

* upgrade scenarios

* Pipeline check

Signed-off-by: daveaugustus <[email protected]>

* Pipeline check

Signed-off-by: daveaugustus <[email protected]>

* changed into iam v1 to v2 force upgrade

* printing license

* integeration tests

* test license

* Pipeline check

Signed-off-by: daveaugustus <[email protected]>

* Pipeline check

Signed-off-by: daveaugustus <[email protected]>

* Pipeline check

Signed-off-by: daveaugustus <[email protected]>

* added print command

Signed-off-by: daveaugustus <[email protected]>

* added license for upgrade

* upgrade status removed license

* added license to bash scripts

Signed-off-by: daveaugustus <[email protected]>

* print license status

* removed license pre run

Signed-off-by: daveaugustus <[email protected]>

* Adding license before restoring backup

Signed-off-by: Yashvi Jain <[email protected]>

* removing applying license from restore command

Signed-off-by: Yashvi Jain <[email protected]>

* Adding gateway start stop in two pipelines

Signed-off-by: Yashvi Jain <[email protected]>

* removed echo statement from script file

Signed-off-by: daveaugustus <[email protected]>

* code review changes

Signed-off-by: daveaugustus <[email protected]>

* typos

Signed-off-by: daveaugustus <[email protected]>

* Adding pipeline changes

Signed-off-by: Yashvi Jain <[email protected]>

* Adding license in ocid package

Signed-off-by: Yashvi Jain <[email protected]>

* updated comments

Signed-off-by: daveaugustus <[email protected]>

* UTC

Signed-off-by: daveaugustus <[email protected]>

* pipeline

Signed-off-by: daveaugustus <[email protected]>

* Skipping the license check for Automate

Signed-off-by: Durga Sarat Chandra Maddu <[email protected]>

* updated error commnet

Signed-off-by: daveaugustus <[email protected]>

* modified error comment for license not applied

Signed-off-by: daveaugustus <[email protected]>

---------

Signed-off-by: Yashvi Jain <[email protected]>
Signed-off-by: Durga Sarat Chandra Maddu <[email protected]>
Signed-off-by: swatign <[email protected]>
Signed-off-by: karan parmar <[email protected]>
Signed-off-by: Aishwarya Aishwarya <[email protected]>
Signed-off-by: daveaugustus <[email protected]>
Signed-off-by: “SanjuPal01” <[email protected]>
Co-authored-by: Yashvi Jain <[email protected]>
Co-authored-by: dmaddu <[email protected]>
Co-authored-by: swatiganesh <[email protected]>
Co-authored-by: kparmar2000 <[email protected]>
Co-authored-by: Aishwarya Aishwarya <[email protected]>
Co-authored-by: swatign <[email protected]>
Co-authored-by: Dave Augustus <[email protected]>
Co-authored-by: daveaugustus <[email protected]>
Co-authored-by: “SanjuPal01” <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Anything related to the Automate docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants