{"id":22311717,"url":"https://github.com/mlukman/securilex","last_synced_at":"2025-03-26T02:17:24.275Z","repository":{"id":57018261,"uuid":"60013050","full_name":"MLukman/Securilex","owner":"MLukman","description":"Security provider for Silex","archived":false,"fork":false,"pushed_at":"2020-06-28T14:14:20.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T23:37:36.495Z","etag":null,"topics":["authentication-factories","firewall","security","silex"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MLukman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-30T13:41:14.000Z","updated_at":"2020-06-28T14:14:08.000Z","dependencies_parsed_at":"2022-08-22T11:31:43.744Z","dependency_job_id":null,"html_url":"https://github.com/MLukman/Securilex","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MLukman%2FSecurilex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MLukman%2FSecurilex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MLukman%2FSecurilex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MLukman%2FSecurilex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MLukman","download_url":"https://codeload.github.com/MLukman/Securilex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573893,"owners_count":20637674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication-factories","firewall","security","silex"],"created_at":"2024-12-03T21:27:01.866Z","updated_at":"2025-03-26T02:17:24.257Z","avatar_url":"https://github.com/MLukman.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Securilex\n\n[![Packagist Version](https://img.shields.io/packagist/v/mlukman/securilex.svg)](https://packagist.org/packages/mlukman/securilex) [![Build Status](https://travis-ci.org/MLukman/Securilex.svg?branch=master)](https://travis-ci.org/MLukman/Securilex)\n\nSecurilex is a simplified security provider for Silex.\n\nThe main class for Securilex is `\\Securilex\\SecurityServiceProvider`.\n\nUsage:\n\n\t// $app is instance of \\Silex\\Application\n\t$app-\u003eregister(new \\Securilex\\ServiceProvider());\n\n    // securilex is now a service\n    $app['securilex']-\u003e ...\n\n## Authentication\nAuthentication deals with identifying user identity via login mechanism. The main class for authentication is `\\Securilex\\Firewall`.\n\nTo define a firewall, you need to define four items:\n\n1. **The path(s) to secure**: whether the whole site (/) or just specific area (/admin/).\n2. **The path to login page** = optional, if none specific it will use browser login popup (i.e. Basic HTTP Authentication).\n3. **The authentication factory** = method of authentication, e.g. plaintext password validation, encoded password validation, LDAP, OAuth etc.\n4. **The user provider** = source to get the list of users, e.g. hard-coded, database etc.\n\nThe first two items are required when constructing a Firewall:\n\n\t$firewall = new \\Securilex\\Firewall('/secure/', '/login/');\n\nYou can define multiple secure paths to be under the same firewall:\n\n\t$firewall = new \\Securilex\\Firewall(array('/secure/', '/admin/'), '/login/');\n\nThe next two items are to be passed to `addAuthenticationFactory` method:\n\n\t$firewall-\u003eaddAuthenticationFactory($authFactory, $userProvider);\n\nRegister the firewall to securilex using `addFirewall()` method:\n\n\t$app['securilex']-\u003eaddFirewall($firewall);\n\n### Authentication Factory\n\nAuthentication Factory defines the method of authentication of user credentials. Securilex comes with a few ready-to-use authentication factories:\n\n - **PlaintextPasswordAuthenticationFactory** - simply compares the entered password with the stored plaintext password.\n - **LdapBindAuthenticationFactory** - authenticates login using external LDAP service.\n - **InitializableAuthenticationFactory** - provides authentication mechanism that remembers the first password that users enter after registration/resetting the password. Requires a user provider that implements `MutableUserProviderInterface` (will be further explained in the next section).\n - **SimpleAuthenticationFactory** - delegates authentication to another class that implements `SimpleAuthenticatorInterface`.\n\nYou can create additional factories by:\n 1. implementing `AuthenticationFactoryInterface` (`LdapBindAuthenticationFactory` does this), or \n 2. extending `SimpleAuthenticationFactory` while implementing `SimpleAuthenticatorInterface` (`PlaintextPasswordAuthenticationFactory` and `InitializableAuthenticationFactory` do this).\n\n### User Provider\n\nUser Provider provides the list of users who have access to the corresponding firewall. Securilex supports all Symfony's existing user providers while it also provides additional ones:\n\n- **NoPasswordUserProvider** - when the application cannot know the passwords of the users, for example when using `LdapBindAuthenticationFactory`.\n- **UserProviderSegmentalizer** - when a list of users needs to be segmentalized to be authenticated by different authentication factories. Instead of defining two user providers with slightly different parameters and potentially causing redundant calls to database or external source, using segmentalizer will cache the user data while it is being authenticated by multiple authentication factories.\n\n## Authorization\nAuthorization deals with allowing or denying access to page or resource.\n\n// TODO: Work In Progress","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlukman%2Fsecurilex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlukman%2Fsecurilex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlukman%2Fsecurilex/lists"}