< Summary - Estud

Information
Class: Estud.Back.Domain.Identity.SsoConfiguration
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Domain/Identity/SsoConfiguration.cs
Tag: 114_29044117136
Line coverage
97%
Covered lines: 41
Uncovered lines: 1
Coverable lines: 42
Total lines: 71
Line coverage: 97.6%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%210%
get_PublicId()100%11100%
get_InstitutionId()100%11100%
get_ProviderType()100%11100%
get_Authority()100%11100%
get_ClientId()100%11100%
get_ClientSecret()100%11100%
get_AllowedDomains()100%11100%
get_IsActive()100%11100%
get_RequireSso()100%11100%
get_CreatedAt()100%11100%
get_UpdatedAt()100%11100%
.ctor()100%11100%
.ctor(...)100%11100%
Update(...)100%11100%

File(s)

/home/runner/work/syki/syki/Back/Domain/Identity/SsoConfiguration.cs

#LineLine coverage
 1namespace Estud.Back.Domain.Identity;
 2
 3/// <summary>
 4/// SSO configuration for an institution.
 5/// </summary>
 6public class SsoConfiguration
 7{
 08    public int Id { get; set; }
 589    public Guid PublicId { get; set; }
 1010    public int InstitutionId { get; set; }
 11
 12    // Provider
 1213    public SsoProviderType ProviderType { get; set; }
 2414    public string Authority { get; set; }
 2415    public string ClientId { get; set; }
 4816    public string ClientSecret { get; set; }
 17
 18    // Domains
 1019    public List<SsoAllowedDomain> AllowedDomains { get; set; }
 20
 21    // Behavior
 1222    public bool IsActive { get; set; }
 1223    public bool RequireSso { get; set; }
 24
 25    // Metadata
 2026    public DateTime CreatedAt { get; set; }
 2427    public DateTime UpdatedAt { get; set; }
 28
 429    public SsoConfiguration() { }
 30
 1031    public SsoConfiguration(
 1032        int orgId,
 1033        SsoProviderType providerType,
 1034        string authority,
 1035        string clientId,
 1036        string clientSecret,
 1037        List<string> allowedDomains)
 38    {
 1039        InstitutionId = orgId;
 1040        PublicId = Guid.NewGuid();
 1041        ProviderType = providerType;
 1042        Authority = authority;
 1043        ClientId = clientId;
 1044        ClientSecret = clientSecret;
 1045        IsActive = true;
 1046        RequireSso = false;
 1047        CreatedAt = DateTime.UtcNow;
 1048        UpdatedAt = CreatedAt;
 49
 1050        AllowedDomains = allowedDomains
 1051            .Select(d => new SsoAllowedDomain(d))
 1052            .ToList();
 1053    }
 54
 55    public void Update(
 56        SsoProviderType providerType,
 57        string authority,
 58        string clientId,
 59        string clientSecret,
 60        bool isActive,
 61        bool requireSso)
 62    {
 263        ProviderType = providerType;
 264        Authority = authority;
 265        ClientId = clientId;
 266        ClientSecret = clientSecret;
 267        IsActive = isActive;
 268        RequireSso = requireSso;
 269        UpdatedAt = DateTime.UtcNow;
 270    }
 71}