Skip to content

IdentityProviderKeys should contains optional attributes #3

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

Open
luca-davanzo opened this issue Nov 14, 2024 · 1 comment
Open

IdentityProviderKeys should contains optional attributes #3

luca-davanzo opened this issue Nov 14, 2024 · 1 comment

Comments

@luca-davanzo
Copy link

luca-davanzo commented Nov 14, 2024

Actual code:

public class IdentityProviderKeys {
    
    public var aruba: String
    public var etna: String
    public var infocamere: String
    public var infocert: String
    public var intesi: String
    public var lepida: String
    public var namirial: String
    public var poste: String
    public var sielte: String
    public var spiditalia: String
    public var teamsystem: String
    public var tim: String
    
    public init(aruba: String, etna: String, infocamere: String, infocert: String, intesi: String, lepida: String, namirial: String, poste: String, sielte: String, spiditalia: String, teamsystem: String, tim: String) {
        self.aruba = aruba
        self.etna = etna
        self.infocamere = infocamere
        self.infocert = infocert
        self.intesi = intesi
        self.lepida = lepida
        self.namirial = namirial
        self.poste = poste
        self.sielte = sielte
        self.spiditalia = spiditalia
        self.teamsystem = teamsystem
        self.tim = tim
    }
    
}

There are cases where we may want to exclude some providers, so I would define string attributes optional.

Also, is there any logical reason to shuffle identity provider array items?

struct IdentityProviderViewModel {
    let identityProviderKeys: IdentityProviderKeys
    
    // Returns the list of providers that is generated by the identity provider object
    func generateProviders() -> [Provider]{
        return [
            Provider(name: IdentityProviderConstants.aruba.rawValue, idp: identityProviderKeys.aruba),
            Provider(name: IdentityProviderConstants.etna.rawValue, idp: identityProviderKeys.etna),
            Provider(name: IdentityProviderConstants.infocamere.rawValue, idp: identityProviderKeys.infocamere),
            Provider(name: IdentityProviderConstants.infocert.rawValue, idp: identityProviderKeys.infocert),
            Provider(name: IdentityProviderConstants.intesi.rawValue, idp: identityProviderKeys.intesi),
            Provider(name: IdentityProviderConstants.lepida.rawValue, idp: identityProviderKeys.lepida),
            Provider(name: IdentityProviderConstants.namirial.rawValue, idp: identityProviderKeys.namirial),
            Provider(name: IdentityProviderConstants.poste.rawValue, idp: identityProviderKeys.poste),
            Provider(name: IdentityProviderConstants.sielte.rawValue, idp: identityProviderKeys.sielte),
            Provider(name: IdentityProviderConstants.spiditalia.rawValue, idp: identityProviderKeys.spiditalia),
            Provider(name: IdentityProviderConstants.teamsystem.rawValue, idp: identityProviderKeys.teamsystem),
            Provider(name: IdentityProviderConstants.tim.rawValue, idp: identityProviderKeys.tim)
        ].shuffled()
    }
    
}
@StefanoVicini
Copy link
Member

Good morning, I will answer in order:

  • in order to help as many citizens as possible we as INPS don't see any reason to exclude a licensed provider from the list
  • the reason we introduced the shuffle feature is because we don’t want to always show the same providers at the top of the list as that might be perceived as us promoting those providers over others

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

No branches or pull requests

2 participants