Ejemplo n.º 1
0
    public function getInstallInserts()
    {
        $now = new DateTime();
        $appKey = Uuid::pseudoRandom();
        $appSecret = hash('sha256', OpenSsl::randomPseudoBytes(256));
        $password = \password_hash('0a29e5bcaa810de0ca0513d9d4ab62f1860f998a', PASSWORD_DEFAULT);
        $passthruSchema = json_encode(['id' => 'http://fusio-project.org', 'title' => 'passthru', 'type' => 'object', 'description' => 'No schema was specified all data will pass thru. Please contact the API provider for more informations about the data format.', 'properties' => new \stdClass()], JSON_PRETTY_PRINT);
        $parser = new Parser();
        $passthruCache = $parser->parse($passthruSchema);
        $welcomeResponse = <<<'JSON'
{
    "message": "Congratulations the installation of Fusio was successful",
    "links": [{
        "rel": "about",
        "name": "http://fusio-project.org"
    }]
}
JSON;
        $welcomeConfig = 'a:1:{i:0;C:15:"PSX\\Data\\Record":605:{a:2:{s:4:"name";s:6:"config";s:6:"fields";a:4:{s:6:"active";b:1;s:6:"status";i:4;s:4:"name";s:1:"1";s:7:"methods";a:4:{i:0;C:15:"PSX\\Data\\Record":140:{a:2:{s:4:"name";s:6:"method";s:6:"fields";a:5:{s:6:"active";b:1;s:6:"public";b:1;s:4:"name";s:3:"GET";s:6:"action";i:1;s:8:"response";i:1;}}}i:1;C:15:"PSX\\Data\\Record":71:{a:2:{s:4:"name";s:6:"method";s:6:"fields";a:1:{s:4:"name";s:4:"POST";}}}i:2;C:15:"PSX\\Data\\Record":70:{a:2:{s:4:"name";s:6:"method";s:6:"fields";a:1:{s:4:"name";s:3:"PUT";}}}i:3;C:15:"PSX\\Data\\Record":73:{a:2:{s:4:"name";s:6:"method";s:6:"fields";a:1:{s:4:"name";s:6:"DELETE";}}}}}}}}';
        return ['fusio_user' => [['status' => 1, 'name' => 'Administrator', 'password' => $password, 'date' => $now->format('Y-m-d H:i:s')]], 'fusio_app' => [['userId' => 1, 'status' => 1, 'name' => 'Backend', 'url' => 'http://fusio-project.org', 'appKey' => $appKey, 'appSecret' => $appSecret, 'date' => $now->format('Y-m-d H:i:s')]], 'fusio_connection' => [['name' => 'Native-Connection', 'class' => 'Fusio\\Connection\\Native', 'config' => null]], 'fusio_scope' => [['name' => 'backend'], ['name' => 'authorization']], 'fusio_action' => [['name' => 'Welcome', 'class' => 'Fusio\\Action\\StaticResponse', 'config' => serialize(['response' => $welcomeResponse]), 'date' => $now->format('Y-m-d H:i:s')]], 'fusio_schema' => [['name' => 'Passthru', 'source' => $passthruSchema, 'cache' => $passthruCache]], 'fusio_routes' => [['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend', 'controller' => 'Fusio\\Backend\\Application\\Index', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/action', 'controller' => 'Fusio\\Backend\\Api\\Action\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/action/list', 'controller' => 'Fusio\\Backend\\Api\\Action\\ListActions::doIndex', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/action/form', 'controller' => 'Fusio\\Backend\\Api\\Action\\ListActions::doDetail', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/action/:action_id', 'controller' => 'Fusio\\Backend\\Api\\Action\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/app', 'controller' => 'Fusio\\Backend\\Api\\App\\Collection', 'config' => null], ['status' => 1, 'methods' => 'DELETE', 'path' => '/backend/app/:app_id/token/:token_id', 'controller' => 'Fusio\\Backend\\Api\\App\\Token::doRemove', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/app/:app_id', 'controller' => 'Fusio\\Backend\\Api\\App\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/connection', 'controller' => 'Fusio\\Backend\\Api\\Connection\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/connection/form', 'controller' => 'Fusio\\Backend\\Api\\Connection\\ListConnections::doDetail', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/connection/list', 'controller' => 'Fusio\\Backend\\Api\\Connection\\ListConnections::doIndex', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/connection/:connection_id', 'controller' => 'Fusio\\Backend\\Api\\Connection\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/log', 'controller' => 'Fusio\\Backend\\Api\\Log\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/log/:log_id', 'controller' => 'Fusio\\Backend\\Api\\Log\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/routes', 'controller' => 'Fusio\\Backend\\Api\\Routes\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/routes/:route_id', 'controller' => 'Fusio\\Backend\\Api\\Routes\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/schema', 'controller' => 'Fusio\\Backend\\Api\\Schema\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/schema/:schema_id', 'controller' => 'Fusio\\Backend\\Api\\Schema\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/schema/preview/:schema_id', 'controller' => 'Fusio\\Backend\\Api\\Schema\\Preview', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/scope', 'controller' => 'Fusio\\Backend\\Api\\Scope\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/scope/:scope_id', 'controller' => 'Fusio\\Backend\\Api\\Scope\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/user', 'controller' => 'Fusio\\Backend\\Api\\User\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/user/:user_id', 'controller' => 'Fusio\\Backend\\Api\\User\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/dashboard/latest_requests', 'controller' => 'Fusio\\Backend\\Api\\Dashboard\\LatestRequests', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/dashboard/latest_apps', 'controller' => 'Fusio\\Backend\\Api\\Dashboard\\LatestApps', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/statistic/incoming_requests', 'controller' => 'Fusio\\Backend\\Api\\Statistic\\IncomingRequests', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/statistic/most_used_routes', 'controller' => 'Fusio\\Backend\\Api\\Statistic\\MostUsedRoutes', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/statistic/most_used_apps', 'controller' => 'Fusio\\Backend\\Api\\Statistic\\MostUsedApps', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/statistic/errors_per_route', 'controller' => 'Fusio\\Backend\\Api\\Statistic\\ErrorsPerRoute', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/account/change_password', 'controller' => 'Fusio\\Backend\\Api\\Account\\ChangePassword', 'config' => null], ['status' => 1, 'methods' => 'GET|POST', 'path' => '/backend/token', 'controller' => 'Fusio\\Backend\\Authorization\\Token', 'config' => null], ['status' => 1, 'methods' => 'POST', 'path' => '/authorization/revoke', 'controller' => 'Fusio\\Authorization\\Revoke', 'config' => null], ['status' => 1, 'methods' => 'GET|POST', 'path' => '/authorization/token', 'controller' => 'Fusio\\Authorization\\Token', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/authorization/whoami', 'controller' => 'Fusio\\Authorization\\Whoami', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/doc', 'controller' => 'PSX\\Controller\\Tool\\DocumentationController::doIndex', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/doc/:version/*path', 'controller' => 'PSX\\Controller\\Tool\\DocumentationController::doDetail', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/', 'controller' => 'Fusio\\Controller\\SchemaApiController', 'config' => $welcomeConfig]], 'fusio_app_scope' => [['appId' => 1, 'scopeId' => 1]], 'fusio_scope_routes' => [['scopeId' => 1, 'routeId' => 1, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 2, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 3, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 4, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 5, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 6, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 7, 'allow' => 1, 'methods' => 'DELETE'], ['scopeId' => 1, 'routeId' => 8, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 9, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 10, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 11, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 12, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 13, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 14, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 15, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 16, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 17, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 18, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 19, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 20, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 21, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 22, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 23, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 24, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 25, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 26, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 27, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 28, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 29, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 30, 'allow' => 1, 'methods' => 'PUT'], ['scopeId' => 1, 'routeId' => 31, 'allow' => 1, 'methods' => 'GET|POST'], ['scopeId' => 1, 'routeId' => 32, 'allow' => 1, 'methods' => 'POST'], ['scopeId' => 1, 'routeId' => 33, 'allow' => 1, 'methods' => 'GET|POST'], ['scopeId' => 1, 'routeId' => 34, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 2, 'routeId' => 32, 'allow' => 1, 'methods' => 'POST'], ['scopeId' => 2, 'routeId' => 33, 'allow' => 1, 'methods' => 'GET|POST'], ['scopeId' => 2, 'routeId' => 34, 'allow' => 1, 'methods' => 'GET']], 'fusio_user_scope' => [['userId' => 1, 'scopeId' => 1]]];
    }
Ejemplo n.º 2
0
 public function getInstallInserts()
 {
     $parser = new Parser();
     $now = new DateTime();
     $appKey = Uuid::pseudoRandom();
     $appSecret = hash('sha256', OpenSsl::randomPseudoBytes(256));
     $password = \password_hash('0a29e5bcaa810de0ca0513d9d4ab62f1860f998a', PASSWORD_DEFAULT);
     $schema = $this->getPassthruSchema();
     $cache = $parser->parse($schema);
     $response = $this->getWelcomeResponse();
     $config = $this->getWelcomeConfig();
     return ['fusio_user' => [['status' => 1, 'name' => 'Administrator', 'password' => $password, 'date' => $now->format('Y-m-d H:i:s')]], 'fusio_app' => [['userId' => 1, 'status' => 1, 'name' => 'Backend', 'url' => 'http://fusio-project.org', 'appKey' => $appKey, 'appSecret' => $appSecret, 'date' => $now->format('Y-m-d H:i:s')]], 'fusio_connection' => [['name' => 'Native-Connection', 'class' => 'Fusio\\Connection\\Native', 'config' => null]], 'fusio_scope' => [['name' => 'backend'], ['name' => 'authorization']], 'fusio_action' => [['name' => 'Welcome', 'class' => 'Fusio\\Action\\StaticResponse', 'config' => serialize(['response' => $response]), 'date' => $now->format('Y-m-d H:i:s')]], 'fusio_schema' => [['name' => 'Passthru', 'source' => $schema, 'cache' => $cache]], 'fusio_routes' => [['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend', 'controller' => 'Fusio\\Backend\\Application\\Index', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/action', 'controller' => 'Fusio\\Backend\\Api\\Action\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/action/list', 'controller' => 'Fusio\\Backend\\Api\\Action\\ListActions::doIndex', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/action/form', 'controller' => 'Fusio\\Backend\\Api\\Action\\ListActions::doDetail', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/action/:action_id', 'controller' => 'Fusio\\Backend\\Api\\Action\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/app', 'controller' => 'Fusio\\Backend\\Api\\App\\Collection', 'config' => null], ['status' => 1, 'methods' => 'DELETE', 'path' => '/backend/app/:app_id/token/:token_id', 'controller' => 'Fusio\\Backend\\Api\\App\\Token::doRemove', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/app/:app_id', 'controller' => 'Fusio\\Backend\\Api\\App\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/connection', 'controller' => 'Fusio\\Backend\\Api\\Connection\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/connection/form', 'controller' => 'Fusio\\Backend\\Api\\Connection\\ListConnections::doDetail', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/connection/list', 'controller' => 'Fusio\\Backend\\Api\\Connection\\ListConnections::doIndex', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/connection/:connection_id', 'controller' => 'Fusio\\Backend\\Api\\Connection\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/log', 'controller' => 'Fusio\\Backend\\Api\\Log\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/log/:log_id', 'controller' => 'Fusio\\Backend\\Api\\Log\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/routes', 'controller' => 'Fusio\\Backend\\Api\\Routes\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/routes/:route_id', 'controller' => 'Fusio\\Backend\\Api\\Routes\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/schema', 'controller' => 'Fusio\\Backend\\Api\\Schema\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/schema/:schema_id', 'controller' => 'Fusio\\Backend\\Api\\Schema\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/schema/preview/:schema_id', 'controller' => 'Fusio\\Backend\\Api\\Schema\\Preview', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/scope', 'controller' => 'Fusio\\Backend\\Api\\Scope\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/scope/:scope_id', 'controller' => 'Fusio\\Backend\\Api\\Scope\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/user', 'controller' => 'Fusio\\Backend\\Api\\User\\Collection', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/user/:user_id', 'controller' => 'Fusio\\Backend\\Api\\User\\Entity', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/dashboard/latest_requests', 'controller' => 'Fusio\\Backend\\Api\\Dashboard\\LatestRequests', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/dashboard/latest_apps', 'controller' => 'Fusio\\Backend\\Api\\Dashboard\\LatestApps', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/statistic/incoming_requests', 'controller' => 'Fusio\\Backend\\Api\\Statistic\\IncomingRequests', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/statistic/most_used_routes', 'controller' => 'Fusio\\Backend\\Api\\Statistic\\MostUsedRoutes', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/statistic/most_used_apps', 'controller' => 'Fusio\\Backend\\Api\\Statistic\\MostUsedApps', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/backend/statistic/errors_per_route', 'controller' => 'Fusio\\Backend\\Api\\Statistic\\ErrorsPerRoute', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/backend/account/change_password', 'controller' => 'Fusio\\Backend\\Api\\Account\\ChangePassword', 'config' => null], ['status' => 1, 'methods' => 'GET|POST', 'path' => '/backend/token', 'controller' => 'Fusio\\Backend\\Authorization\\Token', 'config' => null], ['status' => 1, 'methods' => 'POST', 'path' => '/authorization/revoke', 'controller' => 'Fusio\\Authorization\\Revoke', 'config' => null], ['status' => 1, 'methods' => 'GET|POST', 'path' => '/authorization/token', 'controller' => 'Fusio\\Authorization\\Token', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/authorization/whoami', 'controller' => 'Fusio\\Authorization\\Whoami', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/doc', 'controller' => 'PSX\\Controller\\Tool\\DocumentationController::doIndex', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/doc/:version/*path', 'controller' => 'PSX\\Controller\\Tool\\DocumentationController::doDetail', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/export/wsdl/:version/*path', 'controller' => 'PSX\\Controller\\Tool\\WsdlGeneratorController', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/export/raml/:version/*path', 'controller' => 'PSX\\Controller\\Tool\\RamlGeneratorController', 'config' => null], ['status' => 1, 'methods' => 'GET', 'path' => '/export/swagger/:version/*path', 'controller' => 'PSX\\Controller\\Tool\\SwaggerGeneratorController::doDetail', 'config' => null], ['status' => 1, 'methods' => 'GET|POST|PUT|DELETE', 'path' => '/', 'controller' => 'Fusio\\Controller\\SchemaApiController', 'config' => $config]], 'fusio_app_scope' => [['appId' => 1, 'scopeId' => 1]], 'fusio_scope_routes' => [['scopeId' => 1, 'routeId' => 1, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 2, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 3, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 4, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 5, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 6, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 7, 'allow' => 1, 'methods' => 'DELETE'], ['scopeId' => 1, 'routeId' => 8, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 9, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 10, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 11, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 12, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 13, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 14, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 15, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 16, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 17, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 18, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 19, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 20, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 21, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 22, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 23, 'allow' => 1, 'methods' => 'GET|POST|PUT|DELETE'], ['scopeId' => 1, 'routeId' => 24, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 25, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 26, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 27, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 28, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 29, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 1, 'routeId' => 30, 'allow' => 1, 'methods' => 'PUT'], ['scopeId' => 1, 'routeId' => 31, 'allow' => 1, 'methods' => 'GET|POST'], ['scopeId' => 1, 'routeId' => 32, 'allow' => 1, 'methods' => 'POST'], ['scopeId' => 1, 'routeId' => 33, 'allow' => 1, 'methods' => 'GET|POST'], ['scopeId' => 1, 'routeId' => 34, 'allow' => 1, 'methods' => 'GET'], ['scopeId' => 2, 'routeId' => 32, 'allow' => 1, 'methods' => 'POST'], ['scopeId' => 2, 'routeId' => 33, 'allow' => 1, 'methods' => 'GET|POST'], ['scopeId' => 2, 'routeId' => 34, 'allow' => 1, 'methods' => 'GET']], 'fusio_user_scope' => [['userId' => 1, 'scopeId' => 1]]];
 }
Ejemplo n.º 3
0
 /**
  * Returns the POST response
  *
  * @param \PSX\Data\RecordInterface $record
  * @param \PSX\Api\Version $version
  * @return array|\PSX\Data\RecordInterface
  */
 protected function doCreate(RecordInterface $record, Version $version)
 {
     $this->getValidator()->validate($record);
     $appKey = Uuid::pseudoRandom();
     $appSecret = hash('sha256', OpenSsl::randomPseudoBytes(256));
     $table = $this->tableManager->getTable('Fusio\\Backend\\Table\\App');
     $table->create(array('userId' => $record->getUserId(), 'status' => $record->getStatus(), 'name' => $record->getName(), 'url' => $record->getUrl(), 'appKey' => $appKey, 'appSecret' => $appSecret, 'date' => new DateTime()));
     $appId = $table->getLastInsertId();
     // insert scopes to the app which are assigned to the user
     $this->insertDefaultScopes($appId, $record->getUserId());
     return array('success' => true, 'message' => 'App successful created');
 }
Ejemplo n.º 4
0
 /**
  * Generates the app key
  *
  * @return string
  */
 public static function generateAppKey()
 {
     return Uuid::pseudoRandom();
 }