apigility

ZF2 apigility - How can we validate collections in json data

北慕城南 提交于 2019-12-18 13:38:17
问题 How can I get validated json value using Apigility. For example, I need to get validated user_id under users collection in the following json data. { "log_type": "split food", "meal_type": "Break Fast", "meal_date": "12-2-2015", "users": [ { "user_id": 1, "food_details": [ { "food_id":101 } ] } ] } I know fields can be validated through apigility but here is from json. Thank you 回答1: You should look into the documentation of ZF2 validation for validating (form) collections. Some documentation

ZF2 - ApiGility installed in my own app - route not working

∥☆過路亽.° 提交于 2019-12-11 09:57:08
问题 I am attempting to install APIGILITY in my app. I have followed this tutorial: https://apigility.org/documentation/recipes/apigility-in-an-existing-zf2-application When I attempt to access the apigility admin: www.myapp.dev/apigility I get a "The requested URL could not be matched by routing" error. My config is as follows: 'modules' => array( 'DoctrineModule', 'DoctrineORMModule', 'ZfcRbac', //Keep this at the top 'Application', //The applications main functions run from this module /

Using ZF2 Oauth2

依然范特西╮ 提交于 2019-12-08 07:48:53
问题 I'm trying to get https://github.com/zfcampus/zf-oauth2 working with my Application (mainly because I have installed apigility and zf-oauth2 comes with it). I'm reading the very last section and it says to protect, I just simply use the following code (for instance, at the top of a controller): if (!$this->server->verifyResourceRequest(OAuth2Request::createFromGlobals())) { // Not authorized return 401 error $this->getResponse()->setStatusCode(401); return; } // where $this->server is an

OAUTH2 Refresh Token

ぐ巨炮叔叔 提交于 2019-12-08 05:17:17
问题 I am little confuse of Refresh Token in OAuth2. Like it says access token limit the time window of 1 hour that hacker can use the user credentials and refresh token is long live token which can be use to recreate the access token. I am confused if someone stole the access token from cookie he can also stole the refresh token and can use the refresh token to create new access token as I have ajax request in JQuery (Client Side) NOTE: I have created ajax request to send refresh token on server

OAUTH2 Refresh Token

孤街浪徒 提交于 2019-12-06 15:34:05
I am little confuse of Refresh Token in OAuth2. Like it says access token limit the time window of 1 hour that hacker can use the user credentials and refresh token is long live token which can be use to recreate the access token. I am confused if someone stole the access token from cookie he can also stole the refresh token and can use the refresh token to create new access token as I have ajax request in JQuery (Client Side) NOTE: I have created ajax request to send refresh token on server side I append the Client ID and Secret there with grant type refresh token. I have saved both access

The hydrator settings are ignored in Apigility

痴心易碎 提交于 2019-12-06 07:59:39
问题 In Apigility it's possible to set a Hydrator for every Entity -- either over the Apigility UI or directly in the module.config.php , e.g.: return array( ... 'zf-hal' => array( 'metadata_map' => array( 'Portfolio\\V2\\Rest\\Project\\ProjectEntity' => array( 'entity_identifier_name' => 'id', 'route_name' => 'portfolio.rest.project', 'route_identifier_name' => 'id', 'hydrator' => 'Zend\\Stdlib\\Hydrator\\ObjectProperty', // 'hydrator' => 'MyNamespace\\Hydrator\\ProjectHydrator', ), ... ), ... ),

The hydrator settings are ignored in Apigility

让人想犯罪 __ 提交于 2019-12-04 13:20:11
In Apigility it's possible to set a Hydrator for every Entity -- either over the Apigility UI or directly in the module.config.php , e.g.: return array( ... 'zf-hal' => array( 'metadata_map' => array( 'Portfolio\\V2\\Rest\\Project\\ProjectEntity' => array( 'entity_identifier_name' => 'id', 'route_name' => 'portfolio.rest.project', 'route_identifier_name' => 'id', 'hydrator' => 'Zend\\Stdlib\\Hydrator\\ObjectProperty', // 'hydrator' => 'MyNamespace\\Hydrator\\ProjectHydrator', ), ... ), ... ), ... ); See also the documentation . Currently I'm using the ClassMethods hydrator for all my entities.

How to define the basic HTTP authentication using cURL correctly?

谁都会走 提交于 2019-11-28 16:36:18
I'm learning Apigility ( Apigility docu -> REST Service Tutorial ) and trying to send a POST request with basic authentication via cURL: $ curl -X POST -i -H "Content-Type: application/hal+json" -H "Authorization: Basic YXBpdXNlcjphcGlwd2Q=" http://apigilityhw.sandbox.loc/status YXBpdXNlcjphcGlwd2Q= is the base 64 encoded string with my credentials apiuser:apipwd . The credentials are saved in the /data/htpasswd ( apiuser:$apr1$3J4cyqEw$WKga3rQMkxvnevMuBaekg/ ). The looks like this: HTTP/1.1 401 Unauthorized Server: nginx/1.4.7 Date: Mon, 22 Sep 2014 07:48:47 GMT Content-Type: application

How to define the basic HTTP authentication using cURL correctly?

本秂侑毒 提交于 2019-11-27 09:48:23
问题 I'm learning Apigility (Apigility docu -> REST Service Tutorial) and trying to send a POST request with basic authentication via cURL: $ curl -X POST -i -H "Content-Type: application/hal+json" -H "Authorization: Basic YXBpdXNlcjphcGlwd2Q=" http://apigilityhw.sandbox.loc/status YXBpdXNlcjphcGlwd2Q= is the base 64 encoded string with my credentials apiuser:apipwd . The credentials are saved in the /data/htpasswd ( apiuser:$apr1$3J4cyqEw$WKga3rQMkxvnevMuBaekg/ ). The looks like this: HTTP/1.1