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

License Caching and Add license enforcement to all APIs #3919

Merged
merged 9 commits into from
Oct 9, 2024

Conversation

jashaik
Copy link
Contributor

@jashaik jashaik commented Oct 1, 2024

Description

[Please describe what this change achieves]
Implementation of license cache and changes in web machine to add license enforcement to all APIs
https://progresssoftware.atlassian.net/browse/CHEF-15863
https://progresssoftware.atlassian.net/browse/CHEF-12649

Issues Resolved

[List any existing issues this PR resolves, or any Discourse or
StackOverflow discussions that are relevant]

Check List

Signed-off-by: jan shahid shaik <[email protected]>
Signed-off-by: jan shahid shaik <[email protected]>
Signed-off-by: jan shahid shaik <[email protected]>
@jashaik jashaik requested review from a team as code owners October 1, 2024 11:45
Signed-off-by: jan shahid shaik <[email protected]>
Signed-off-by: jan shahid shaik <[email protected]>
Signed-off-by: jan shahid shaik <[email protected]>
@jashaik
Copy link
Contributor Author

jashaik commented Oct 4, 2024

@jashaik
Copy link
Contributor Author

jashaik commented Oct 4, 2024

@jashaik
Copy link
Contributor Author

jashaik commented Oct 4, 2024

Manual testing results
Screenshot 2024-10-04 at 12 52 02 PM

@jashaik
Copy link
Contributor Author

jashaik commented Oct 4, 2024

Screenshot 2024-10-04 at 12 57 21 PM

@jashaik
Copy link
Contributor Author

jashaik commented Oct 4, 2024

Screenshot 2024-10-04 at 1 03 58 PM

Signed-off-by: jan shahid shaik <[email protected]>
"/_status" ->
{true, Req, State3};
_ ->
case chef_license_worker:get_license() of
Copy link
Member

@marcparadise marcparadise Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we handle this case statement as a function, something like

_ -> 
  check_license(chef_license_worker:get_license(), Req, State3) 

And:

check_license({valid_license..... }, Req, State ) ->
  { true, Req, State} ;
check_license({commercial_grace_period...
... etc

Makes it a little easier to test, and avoids deeply nesting the contents of service_available which makes it easier to parse.

Signed-off-by: jan shahid shaik <[email protected]>
Signed-off-by: jan shahid shaik <[email protected]>
Copy link

sonarcloud bot commented Oct 8, 2024

@jashaik
Copy link
Contributor Author

jashaik commented Oct 8, 2024

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@jashaik
Copy link
Contributor Author

jashaik commented Oct 8, 2024

Please find the below results: Working x-ops-license and _status API without license
Screenshot 2024-10-08 at 11 49 41 AM
Screenshot 2024-10-08 at 11 50 17 AM

Copy link
Collaborator

@talktovikas talktovikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sreepuramsudheer sreepuramsudheer merged commit 607e4ca into feature/CHEF-11396 Oct 9, 2024
8 checks passed
@sreepuramsudheer sreepuramsudheer deleted the shahid/CHEF-15863+CHEF-12649 branch October 9, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants