Add Ruby language analyzer and related functionality
- Introduced global usings for Ruby analyzer. - Implemented RubyLockData, RubyLockEntry, and RubyLockParser for handling Gemfile.lock files. - Created RubyPackage and RubyPackageCollector to manage Ruby packages and vendor cache. - Developed RubyAnalyzerPlugin and RubyLanguageAnalyzer for analyzing Ruby projects. - Added tests for Ruby language analyzer with sample Gemfile.lock and expected output. - Included necessary project files and references for the Ruby analyzer. - Added third-party licenses for tree-sitter dependencies.
This commit is contained in:
@@ -861,6 +861,7 @@ public sealed class AuthorityTenantOptions
|
||||
public sealed class AuthorityDelegationOptions
|
||||
{
|
||||
private readonly IList<AuthorityServiceAccountSeedOptions> serviceAccounts = new List<AuthorityServiceAccountSeedOptions>();
|
||||
private readonly Dictionary<string, AuthorityTenantDelegationOptions> tenantOverrides = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public AuthorityDelegationQuotaOptions Quotas { get; } = new();
|
||||
|
||||
@@ -878,6 +879,17 @@ public sealed class AuthorityDelegationOptions
|
||||
: new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
var seenAccounts = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
tenantOverrides.Clear();
|
||||
foreach (var tenant in tenants)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(tenant.Id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var normalizedTenant = tenant.Id.Trim().ToLowerInvariant();
|
||||
tenantOverrides[normalizedTenant] = tenant.Delegation;
|
||||
}
|
||||
|
||||
foreach (var account in serviceAccounts)
|
||||
{
|
||||
@@ -890,6 +902,22 @@ public sealed class AuthorityDelegationOptions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int ResolveMaxActiveTokens(string? tenantId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(tenantId))
|
||||
{
|
||||
return Quotas.MaxActiveTokens;
|
||||
}
|
||||
|
||||
var normalized = tenantId.Trim().ToLowerInvariant();
|
||||
if (tenantOverrides.TryGetValue(normalized, out var options))
|
||||
{
|
||||
return options.ResolveMaxActiveTokens(this);
|
||||
}
|
||||
|
||||
return Quotas.MaxActiveTokens;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class AuthorityDelegationQuotaOptions
|
||||
|
||||
Reference in New Issue
Block a user