/// <summary> /// Constructor generated by new user /// </summary> /// <param name="u"></param> public License(Users.Users u) { // New license string rnd = Security.CryptoUtils.RandomKey(); Id = Security.CryptoUtils.SHA1HashStringForUTF8String(rnd); IdLicense = u.Username.Substring(0, 2) + "-" + Security.CryptoUtils.SHA256HashStringForUTF8String(rnd); // Add to database New(); }
/// <summary> /// Constructor that creates a proyect, creates a license for it and then creates a UserLicense linking the new License and the user that created /// this proyect. /// </summary> /// <param name="title"></param> /// <param name="summary"></param> /// <param name="idTemplate"></param> /// <param name="idLicense"></param> /// <param name="u"></param> public Proyects(string title, string summary, string creator, string website, string repository, string support, Users.Users u) { Id = Security.CryptoUtils.SHA256HashStringForUTF8String(lovis.Security.CryptoUtils.RandomKey()); // Create a new License for this PROYECT License.License L = new License.License(u); // Set IdLicense for this Proyect IDLICENSE IdLicense = L.IdLicense; // Create a UserLicens with this new IdLicense and IdUser UserLicense.UserLicense UL = new UserLicense.UserLicense(u.Id, IdLicense, 0, false); Title = Security.CryptoUtils.EncodeElementString(this, title); Summary = Security.CryptoUtils.EncodeElementString(this, summary); Owner = Security.CryptoUtils.EncodeElementString(this, creator); Repository = Security.CryptoUtils.EncodeElementString(this, repository); Website = Security.CryptoUtils.EncodeElementString(this, website); Support = Security.CryptoUtils.EncodeElementString(this, support); // Add to list lP.Add(this); }
/// <summary> /// Constructor filled with current User /// </summary> /// <param name="u"></param> public Proyects(Users.Users u) { }
public KeycloakClientShould() { if (AttackDetectionClient == null) { AttackDetectionClient = new AttackDetection.AttackDetection(); } if (AuthenticationManagementClient == null) { AuthenticationManagementClient = new AuthenticationManagement.AuthenticationManagement(); } if (ClientAttributeCertificateClient == null) { ClientAttributeCertificateClient = new ClientAttributeCertificate.ClientAttributeCertificate(); } if (ClientInitialAccessClient == null) { ClientInitialAccessClient = new ClientInitialAccess.ClientInitialAccess(); } if (ClientRegistrationPolicyClient == null) { ClientRegistrationPolicyClient = new ClientRegistrationPolicy.ClientRegistrationPolicy(); } if (ClientRoleMappingsClient == null) { ClientRoleMappingsClient = new ClientRoleMappings.ClientRoleMappings(); } if (ClientsClient == null) { ClientsClient = new Clients.Clients(); } if (ClientScopesClient == null) { ClientScopesClient = new ClientScopes.ClientScopes(); } if (ComponentsClient == null) { ComponentsClient = new Components.Components(); } if (GroupsClient == null) { GroupsClient = new Groups.Groups(); } if (IdentityProvidersClient == null) { IdentityProvidersClient = new IdentityProviders.IdentityProviders(); } if (KeyClient == null) { KeyClient = new Key.Key(); } if (ProtocolMappersClient == null) { ProtocolMappersClient = new ProtocolMappers.ProtocolMappers(); } if (RealmsAdminClient == null) { RealmsAdminClient = new RealmsAdmin.RealmsAdmin(); } if (RoleMapperClient == null) { RoleMapperClient = new RoleMapper.RoleMapper(); } if (RolesClient == null) { RolesClient = new Roles.Roles(); } if (RolesByIdClient == null) { RolesByIdClient = new RolesById.RolesById(); } if (RootClient == null) { RootClient = new Root.Root(); } if (ScopeMappingsClient == null) { ScopeMappingsClient = new ScopeMappings.ScopeMappings(); } if (UsersClient == null) { UsersClient = new Users.Users(); } if (UserStorageProviderClient == null) { UserStorageProviderClient = new UserStorageProvider.UserStorageProvider(); } }