{"id":15296389,"url":"https://github.com/00f100/fcphp-sconsole","last_synced_at":"2026-01-06T07:02:24.723Z","repository":{"id":56894019,"uuid":"142705842","full_name":"00F100/fcphp-sconsole","owner":"00F100","description":"Package security console requests","archived":false,"fork":false,"pushed_at":"2018-08-04T15:56:16.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T05:43:41.277Z","etag":null,"topics":["console","fcphp","php7","php72","request","security"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/00F100.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":"2018-07-28T19:50:03.000Z","updated_at":"2022-02-12T12:39:28.000Z","dependencies_parsed_at":"2022-08-21T01:20:23.127Z","dependency_job_id":null,"html_url":"https://github.com/00F100/fcphp-sconsole","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/00F100/fcphp-sconsole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-sconsole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-sconsole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-sconsole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-sconsole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/00F100","download_url":"https://codeload.github.com/00F100/fcphp-sconsole/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-sconsole/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28223114,"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","status":"online","status_checked_at":"2026-01-06T02:00:07.049Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["console","fcphp","php7","php72","request","security"],"created_at":"2024-09-30T18:10:20.234Z","updated_at":"2026-01-06T07:02:24.690Z","avatar_url":"https://github.com/00F100.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FcPhp Security Console\n\nLibrary to manipulate auth of user into Console\n\n[![Build Status](https://travis-ci.org/00F100/fcphp-sconsole.svg?branch=master)](https://travis-ci.org/00F100/fcphp-sconsole) [![codecov](https://codecov.io/gh/00F100/fcphp-sconsole/branch/master/graph/badge.svg)](https://codecov.io/gh/00F100/fcphp-sconsole) [![Total Downloads](https://poser.pugx.org/00F100/fcphp-sconsole/downloads)](https://packagist.org/packages/00F100/fcphp-sconsole)\n\n## How to install\n\nComposer:\n```sh\n$ composer require 00f100/fcphp-sconsole\n```\n\nor add in composer.json\n```json\n{\n    \"require\": {\n        \"00f100/fcphp-sconsole\": \"*\"\n    }\n}\n```\n\n## How to use\n\n```php\n\u003c?php\n\nuse FcPhp\\SConsole\\Facades\\SConsoleFacade;\nuse FcPhp\\SConsole\\Interfaces\\ISCEntity;\n\n// Init instance\n$instance = SConsoleFacade::getInstance();\n\n// Configure Callback\n$instance-\u003eauthCallback(function(ISCEntity $entity, array $params, array $server) {\n\n    // Your validate code here...\n\n    $entity-\u003esetType('user');\n    // $entity-\u003esetType('admin');\n    // default: $entity-\u003esetType('guest');\n    $entity-\u003esetName('any name');\n    return $entity;\n});\n\n// FcPhp\\SConsole\\Interfaces\\ISCEntity\n$SecurityConsoleEntity = $instance-\u003eget();\n\n// Print: any name\necho $SecurityConsoleEntity-\u003egetName();\n```\n\n#### [FcPhp\\SConsole\\Interfaces\\ISCEntity](https://github.com/00F100/fcphp-sconsole/blob/master/src/Interfaces/ISCEntity.php)\n\n```php\ninterface ISCEntity\n    {\n        /**\n         * Method to construct instance of Security Entity\n         *\n         * @param int $expires Timestamp expires Security Entity\n         * @return void\n         */\n        public function __construct(int $expires = 84000);\n\n        /**\n         * Method to set Id of login\n         *\n         * @param string $id Id of login\n         * @return cPhp\\SHttp\\Interfaces\\ISEntity\n         */\n        public function setId(string $id) :ISEntity;\n\n        /**\n         * Method to get Id of login\n         *\n         * @return string|null\n         */\n        public function getId();\n\n        /**\n         * Method to set Name of login\n         *\n         * @param string $name Name of login\n         * @return cPhp\\SHttp\\Interfaces\\ISEntity\n         */\n        public function setName(string $name) :ISEntity;\n\n        /**\n         * Method to get Name of login\n         *\n         * @return string|null\n         */\n        public function getName();\n\n        /**\n         * Method to set E-mail of login\n         *\n         * @param string $email E-mail of login\n         * @return cPhp\\SHttp\\Interfaces\\ISEntity\n         */\n        public function setEmail(string $email) :ISEntity;\n        /**\n         * Method to get E-mail of login\n         *\n         * @return string|null\n         */\n        public function getEmail();\n\n        /**\n         * Method to set User name of login\n         *\n         * @param string $username User name of login\n         * @return cPhp\\SHttp\\Interfaces\\ISEntity\n         */\n        public function setUsername(string $username) :ISEntity;\n        /**\n         * Method to get User name of login\n         *\n         * @return string|null\n         */\n        public function getUsername();\n\n        /**\n         * Method to set Type of login\n         *\n         * @param string|int $type Type of login\n         * @return cPhp\\SHttp\\Interfaces\\ISEntity\n         */\n        public function setType($type) :ISEntity;\n        /**\n         * Method to get Type of login\n         *\n         * @return string\n         */\n        public function getType() :string;\n\n        /**\n         * Method to set Permissions of login\n         *\n         * @param array $permissions Permissions of login\n         * @return cPhp\\SHttp\\Interfaces\\ISEntity\n         */\n        public function setPermissions(array $permissions) :ISEntity;\n        /**\n         * Method to get Permissions of login\n         *\n         * @return array\n         */\n        public function getPermissions() :array;\n        /**\n         * Method to check if have access to permission\n         *\n         * @param string $permission Permission to check\n         * @return bool\n         */\n        public function check(string $permission) :bool;\n\n        /**\n         * Method to set Custom data of login\n         *\n         * @param string $key Key to save content\n         * @param array|string $customData Data to save\n         * @return cPhp\\SHttp\\Interfaces\\ISEntity\n         */\n        public function setCustomData(string $key, $customData) :ISEntity;\n        /**\n         * Method to get Custom data of login\n         *\n         * @param string|null $key Key to find content\n         * @return array|null\n         */\n        public function getCustomData(string $key = null);\n\n        /**\n         * Method to set Errors of login\n         *\n         * @param string $message Message of error\n         * @return cPhp\\SHttp\\Interfaces\\ISEntity\n         */\n        public function setError(string $message) :ISEntity;\n\n        /**\n         * Method to get Errors of login\n         *\n         * @return array\n         */\n        public function getError() :array;\n        \n        /**\n         * Method to check if have errors in login\n         *\n         * @return bool\n         */\n        public function haveErrors() :bool;\n\n        /**\n         * Method to check if this Security Entity has expired\n         *\n         * @return bool\n         */\n        public function isExpired() :bool;\n    }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F00f100%2Ffcphp-sconsole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F00f100%2Ffcphp-sconsole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F00f100%2Ffcphp-sconsole/lists"}