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

Merge dev into master #1978

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PermissionsService/Services/PermissionsStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
private const string PermissionsNameBlobConfig = "BlobStorage:Blobs:Permissions:Name";
private const string PermissionsContainerBlobConfig = "BlobStorage:Containers:Permissions";
private const string NullValueError = "Value cannot be null";
private class PermissionsDataInfo

Check warning on line 56 in PermissionsService/Services/PermissionsStore.cs

View workflow job for this annotation

GitHub Actions / Build

Private classes which are not derived in the current assembly should be marked as 'sealed'. (https://rules.sonarsource.com/csharp/RSPEC-3260)

Check warning on line 56 in PermissionsService/Services/PermissionsStore.cs

View workflow job for this annotation

GitHub Actions / Build

Private classes which are not derived in the current assembly should be marked as 'sealed'. (https://rules.sonarsource.com/csharp/RSPEC-3260)
{
public UriTemplateMatcher UriTemplateMatcher
{
Expand Down Expand Up @@ -308,7 +308,7 @@
_telemetryClient?.TrackTrace($"{nameof(scopesInfoJson)} empty or null when creating the scopes information tables",
SeverityLevel.Error,
_permissionsTraceProperties);
return null;

Check warning on line 311 in PermissionsService/Services/PermissionsStore.cs

View workflow job for this annotation

GitHub Actions / Build

Return an empty collection instead of null. (https://rules.sonarsource.com/csharp/RSPEC-1168)

Check warning on line 311 in PermissionsService/Services/PermissionsStore.cs

View workflow job for this annotation

GitHub Actions / Build

Return an empty collection instead of null. (https://rules.sonarsource.com/csharp/RSPEC-1168)
}

_telemetryClient?.TrackTrace("Creating the scopes information tables",
Expand All @@ -333,7 +333,7 @@
}

///<inheritdoc/>
public async Task<PermissionResult> GetScopesAsync(List<RequestInfo> requests = null,

Check warning on line 336 in PermissionsService/Services/PermissionsStore.cs

View workflow job for this annotation

GitHub Actions / Build

Refactor this method to reduce its Cognitive Complexity from 36 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)

Check warning on line 336 in PermissionsService/Services/PermissionsStore.cs

View workflow job for this annotation

GitHub Actions / Build

Refactor this method to reduce its Cognitive Complexity from 36 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
string locale = DefaultLocale,
ScopeType? scopeType = null,
bool includeHidden = false,
Expand All @@ -358,7 +358,7 @@
}
else
{
var authZChecker = new AuthZChecker();
var authZChecker = new AuthZChecker() { LenientMatch = true };
authZChecker.Load(permissionsDocument);

var scopesByRequestUrl = new ConcurrentDictionary<string, IEnumerable<ScopeInformation>>();
Expand Down Expand Up @@ -402,7 +402,7 @@

// If any of the higher privilege permissions is a leastPrivilegePermissions somewhere, ignore
bool foundInOthers = higherPrivilegedScopes.Any(scope =>
allLeastPrivilegeScopes.Any(leastScope =>

Check warning on line 405 in PermissionsService/Services/PermissionsStore.cs

View workflow job for this annotation

GitHub Actions / Build

Collection-specific "Exists" method should be used instead of the "Any" extension. (https://rules.sonarsource.com/csharp/RSPEC-6605)

Check warning on line 405 in PermissionsService/Services/PermissionsStore.cs

View workflow job for this annotation

GitHub Actions / Build

Collection-specific "Exists" method should be used instead of the "Any" extension. (https://rules.sonarsource.com/csharp/RSPEC-6605)
leastScope.ScopeName.Equals(scope.ScopeName, StringComparison.OrdinalIgnoreCase) &&
leastScope.ScopeType == scope.ScopeType));

Expand Down Expand Up @@ -478,7 +478,7 @@
else
{
return allPermissions
.Where(x => x.Value.Schemes.Keys.Any(k => k.Equals(scopeType.ToString(),StringComparison.OrdinalIgnoreCase)))
.Where(x => x.Value.Schemes.Keys.Any(k => k.Equals(scopeType.ToString(), StringComparison.OrdinalIgnoreCase)))
.Select(grant => new ScopeInformation
{
ScopeName = grant.Key,
Expand Down
Loading