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

Optimize Sonar scans #3872

Closed
wants to merge 173 commits into from
Closed

Optimize Sonar scans #3872

wants to merge 173 commits into from

Conversation

withinfocus
Copy link
Contributor

@withinfocus withinfocus commented Mar 4, 2024

Type of change

- [ ] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [X] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Optimizes the Sonar run for .NET.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • If making database changes - make sure you also update Entity Framework queries and/or migrations
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.33%. Comparing base (45be4d5) to head (61a1ade).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3872   +/-   ##
=======================================
  Coverage   38.33%   38.33%           
=======================================
  Files        1209     1209           
  Lines       58686    58686           
  Branches     5589     5589           
=======================================
  Hits        22495    22495           
  Misses      35147    35147           
  Partials     1044     1044           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@withinfocus withinfocus changed the title Optimize Sonar scans and perform PR run checks Optimize Sonar scans Mar 6, 2024
Copy link
Contributor

github-actions bot commented May 8, 2024

Logo
Checkmarx One – Scan Summary & Details8cbc3a6b-b0c2-4224-8d96-953fbaf190c6

No New Or Fixed Issues Found

vincentsalucci and others added 21 commits July 9, 2024 15:44
* feat: Update authorization handler to handle V1 collection enhancement, refs AC-2086

* feat: update tests to account for new V1 flag/setting logic, refs AC-2086

* feat: update CanDelete with all collection enhancement combinations, refs AC-2086

* feat: add tests for new delete flows, refs AC-2086

* fix: update new conditionals with bool return value, refs AC-2086

* feat: simplify conditional in regards to LimitCollectionCreationDeletion, refs AC-2086

* feat: simplify AllowAdminAccessToAllCollectionItems conditional, refs AC-2086

* feat: add unit test making sure admins can't delete collections without can manage, refs AC-2086
…ripe objects (#3999)

* Prevent calls to Stripe when unlinking client org has no Stripe objects

* Thomas' feedback

* Check for stripe when org unlinked from org page

---------

Co-authored-by: Conner Turnbull <[email protected]>
…e flag (#4002)

* Removed business logic that references flag

* Removed using statement.

* Undid accidental keystroke.

* Removed unused method.

* Removed unused imports.
…4054)

* Add unit tests for the StorageSubscriptionUpdateTests.cs

Signed-off-by: Cy Okeke <[email protected]>

* remove unwanted comment from the class

Signed-off-by: Cy Okeke <[email protected]>

* Create a class file and add unit tests for SmSeatSubscriptionUpdateTest.cs

Signed-off-by: Cy Okeke <[email protected]>

* Add unit test for the secrets manager seat update

Signed-off-by: Cy Okeke <[email protected]>

* Fix the failing test cases

Signed-off-by: Cy Okeke <[email protected]>

* Add unit test for service account update

Signed-off-by: Cy Okeke <[email protected]>

---------

Signed-off-by: Cy Okeke <[email protected]>
* Formatting

* Add Gateway fields to provider edit

* Remove unnecessary usings

* Thomas' feedback

* Removing unnecessary using for linter

* Removing unused file

* Removing unused file
* Removed unused feature flags

* Removed 2 more flags.
* Allow editing of client organization name

* Removing unnecessary using for linter
* Add null check to groups endpoint - providers may not be OrgUsers
* For SM Trial orgs, now scaling PM seat count with SM seat count adjustments

* Split Billing related organization endpoints into billing owned controller

* Updated billing organizations controller to use a primary constructor to reduce boilerplate

* Fixed error where ID couldn't be mapped to subscription endpoint guid param

* Updated billing OrganizationController endpoints to not manually create the GUID from the string ID

* Banished magic string back to the pit from whence it came

* Resolved errors in unit tests
…e Org Policy (#4087)

* fix: align policy checks for excluded types, update tests, create fixture, refs AC-240

* fix: update final policy check against other orgs (not including the current), refs AC-240
#4011)

* Add auto-scale support to standalone SM for SCIM

* Mark users for SM when using SM Stadalone with Directory Connector
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ike <[email protected]>
* Make custom users subject to collection settings
  Affects ManageUsers and ManageGroups
eliykat and others added 28 commits July 9, 2024 15:44
…Repository (#4282)

Remove FlexibleCollections feature flag logic for repository methods:
* CiphersController.GetByIdAsync
* CipherRepository.DeleteAsync
* CipherRepository.MoveAsync
* RestoreAsync
* SoftDeleteAsync

This feature flag was never turned on and we will update the sprocs
directly as required.
…ionCipher Repository (#4284)

Remove FlexibleCollections feature flag logic for repository methods:
* GetManyByUserIdAsync
* GetManyByUserIdCipherIdAsync
* UpdateCollectionsAsync
* UpdateCollectionsForCiphersAsync

This feature flag was never turned on and we will update the sprocs
directly as required.
…ailsView` (#4446)

* Add 'AssignedSeats' to ProviderOrganizationOrganizationDetailsView

* Add newline

* Thomas' feedback
* Show a more detailed error message if duplicate GUIDS are passed ot get by Ids

* Update test/Api.IntegrationTest/SecretsManager/Controllers/SecretsControllerTests.cs

Co-authored-by: Thomas Avery <[email protected]>

* Update src/Api/SecretsManager/Models/Request/GetSecretsRequestModel.cs

Co-authored-by: Thomas Avery <[email protected]>

* Update src/Api/SecretsManager/Models/Request/GetSecretsRequestModel.cs

Co-authored-by: Thomas Avery <[email protected]>

* Making requested changes to tests

* lint fix

* fixing whitespace

---------

Co-authored-by: Thomas Avery <[email protected]>
* Sql-backed IDistributedCache

* sqlserver cache table

* remove unused using

* setup EF entity

* cache indexes

* add back cipher

* revert SetupEntityFramework change

* ef cache

* EntityFrameworkCache

* IServiceScopeFactory for db context

* implement EntityFrameworkCache

* move to _serviceScopeFactory

* move to config file

* ef migrations

* fixes

* datetime and error codes

* revert migrations

* migrations

* format

* static and namespace fix

* use time provider

* Move SQL migration and remove EF one for the moment

* Add clean migration of just the new table

* Formatting

* Test Custom `IDistributedCache` Implementation

* Add Back Logging

* Remove Double Logging

* Skip Test When Not EntityFrameworkCache

* Format

---------

Co-authored-by: Matt Bishop <[email protected]>
Co-authored-by: Justin Baur <[email protected]>
* Enable `nullable` For Collection

* Enable `nullable` For `CollectionCipher`

* Enable `nullable` For `CollectionGroup`

* Enable `nullable` For `CollectionUser`

* Enable `nullable` For `Device`

* Enable `nullable` For `Event`

* Enable `nullable` For `Folder`

* Enable `nullable` For `Installation`

* Enable `nullable` For `IRevisable`

* Enable `nullable` For `IStorable`

* Enable `nullable` For `IStorableSubscriber`

* Enable `nullable` For `ITableObject`

* Enable `nullable` For `OrganizationApiKey`

* Enable `nullable` For `OrganizationConnection`

* Enable `nullable` For `OrganizationDomain`

* Enable `nullable` For `OrganizationSponsorship`

* Enable `nullable` For `Role`

* Enable `nullable` For `TaxRate`

* Enable `nullable` For `Transaction`

* Enable `nullable` For `User`
* Enable `nullable` for `ApiKey`

* Switch to Using `required`

* Make Scope Be Valid JSON

* Update test/Api.IntegrationTest/SecretsManager/Controllers/ServiceAccountsControllerTests.cs

Co-authored-by: Thomas Avery <[email protected]>

* Apply suggestions from code review

Co-authored-by: Maciej Zieniuk <[email protected]>

* Move Nullable Directive

---------

Co-authored-by: Thomas Avery <[email protected]>
Co-authored-by: Maciej Zieniuk <[email protected]>
* Enable `nullable` For Billing Entities

* Remove .gitignore Change
* Update Database Models

* Format
* Enable `nullable` in `ISubscriber`

* Enable `nullable` in `Group`

* Enable `nullable` in `GroupUser`

* Enable `nullable` in `Organization`

* Enable `nullable` in `OrganizationUser`

* Enable `nullable` in `Policy`

* Enable `nullable` in `Provider`

* Enable `nullable` in `ProviderOrganization`

* Enable `nullable` in `ProviderUser`

* Update Tests

* Formatting

* Update TwoFactor Tests

* Fix Scim Tests

* Format

* Add Migrations

* Format
* Add client ID to provider client invoice report

* Run dotnet format
* Optionally Run `docker-compose`

* Use Traversal Projects Over Solution Files

* Cleanup VSCode Tasks

* Bind DataProtection Keys to Host

- Makes it so the container can be rebuilt without corrupting data

* Update .vscode/tasks.json

Co-authored-by: Matt Bishop <[email protected]>

---------

Co-authored-by: Matt Bishop <[email protected]>
* chore: remove EditAssignedCollections from current context, refs AC-2662

* chore: remove DeleteAssignedCollections from CurrentContext, refs AC-2662

* chore: remove ViewAssignedCollections from CurrentContext, refs AC-2662
Final removal of AccessAll logic in CollectionCipher sprocs. We had v2 sprocs already
containing this updated logic that were never used; copy the v2 logic back to the 
original sprocs so that we start using it. v2 sprocs will be dropped later.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Remove AccessAll logic from UserCollectionDetails and UserCipherDetails
  and EF equivalents
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Add AccessToSecretsAsync to the repository

* Add BulkSecretAuthorizationHandler

* Update controller to use the new authz handler

* Add integration test coverage
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@withinfocus withinfocus closed this Jul 9, 2024
@withinfocus withinfocus deleted the sonar-and-checks branch July 9, 2024 19:51
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.