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

Fix quota overflow #286

Merged
merged 2 commits into from
Jul 8, 2024
Merged

Fix quota overflow #286

merged 2 commits into from
Jul 8, 2024

Conversation

KerryKovacevic
Copy link
Contributor

Description

Update quota integers to unsigned so there is no overflow when a large quota is requested.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#1368

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Unit tests
lglou237:~/karavi-authorization # make test
podman run --rm -it -v /root/karavi-authorization/policies:/policies/ openpolicyagent/opa test -v /policies/
/policies/volumes_create_test.rego:
data.karavi.volumes.create.test_small_request_allowed: PASS (22.065216ms)
data.karavi.volumes.create.test_large_request_not_allowed: PASS (778.949µs)
--------------------------------------------------------------------------------
PASS: 2/2
go test -count=1 -cover -race -timeout 30s -short ./...
        karavi-authorization/cmd/karavictl              coverage: 0.0% of statements
        karavi-authorization/cmd/karavictl/cmd/api/mocks                coverage: 0.0% of statements
ok      karavi-authorization/cmd/karavictl/cmd  1.522s  coverage: 25.6% of statements
ok      karavi-authorization/cmd/karavictl/cmd/api      1.296s  coverage: 57.0% of statements
        karavi-authorization/cmd/role-service           coverage: 0.0% of statements
ok      karavi-authorization/cmd/proxy-server   6.634s  coverage: 6.9% of statements
        karavi-authorization/cmd/storage-service                coverage: 0.0% of statements
ok      karavi-authorization/cmd/sidecar-proxy  1.355s  coverage: 5.2% of statements
        karavi-authorization/internal/decision          coverage: 0.0% of statements
ok      karavi-authorization/cmd/tenant-service 1.268s  coverage: 2.4% of statements
ok      karavi-authorization/deploy     2.196s  coverage: 84.3% of statements
ok      karavi-authorization/internal/k8s       1.452s  coverage: 4.9% of statements
        karavi-authorization/internal/role-service/mocks                coverage: 0.0% of statements
ok      karavi-authorization/internal/powerflex 11.192s coverage: 91.4% of statements
ok      karavi-authorization/internal/proxy     21.560s coverage: 34.6% of statements
ok      karavi-authorization/internal/quota     1.505s  coverage: 90.2% of statements
ok      karavi-authorization/internal/role-service      1.242s  coverage: 7.6% of statements
ok      karavi-authorization/internal/role-service/middleware   1.238s  coverage: 5.2% of statements
ok      karavi-authorization/internal/role-service/roles        1.259s  coverage: 87.4% of statements
ok      karavi-authorization/internal/role-service/validate     2.117s  coverage: 6.4% of statements
ok      karavi-authorization/internal/sdc       1.206s  coverage: 96.8% of statements
        karavi-authorization/internal/storage-service/mocks             coverage: 0.0% of statements
ok      karavi-authorization/internal/storage-service   3.737s  coverage: 13.4% of statements
ok      karavi-authorization/internal/storage-service/middleware        1.446s  coverage: 7.3% of statements
        karavi-authorization/internal/tenantsvc/mocks           coverage: 0.0% of statements
ok      karavi-authorization/internal/tenantsvc 9.372s  coverage: 9.4% of statements
ok      karavi-authorization/internal/tenantsvc/middleware      1.598s  coverage: 8.2% of statements
ok      karavi-authorization/internal/token     1.475s  coverage: 3.4% of statements
        karavi-authorization/pb         coverage: 0.0% of statements
ok      karavi-authorization/internal/token/jwx 1.292s  coverage: 7.6% of statements
ok      karavi-authorization/internal/web       1.305s  coverage: 6.2% of statements

@alikdell
Copy link
Collaborator

alikdell commented Jul 8, 2024

Do we really need to fix this in this repo?

@EvgenyUglov
Copy link
Contributor

e2e pass

@EvgenyUglov EvgenyUglov merged commit 4436927 into main Jul 8, 2024
8 checks passed
@EvgenyUglov EvgenyUglov deleted the fix-quota-overflow branch July 8, 2024 15:31
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