This shows you the differences between two versions of the page.
api_webservice_adaptor [2024/12/09 15:22] montse [Functions] |
api_webservice_adaptor [2024/12/10 15:37] (current) montse [Authentication Types] |
||
---|---|---|---|
Line 25: | Line 25: | ||
* **deleteRest(resource, headers)** | * **deleteRest(resource, headers)** | ||
- | * Description: It allows the configuration of an HTTP request of type Delete. | + | * Description: it allows the configuration of an HTTP request of type Delete. |
- | * Resource: Indicates the resource within the EndPoint on which the request will be made. | + | * Resource: indicates the resource within the EndPoint on which the request will be made. |
- | * Headers: Indicates the headers that must be added to the request. | + | * Headers: indicates the headers that must be added to the request. |
- | * Charset: To choose what charset the user wants. | + | * Charset: to choose what charset the user wants. |
- | * Body: Indicates que content of the parameter. | + | * Body: indicates que content of the parameter. |
* **getALLJSONElementValueByTagname(ResponseName, JsonTagName)** | * **getALLJSONElementValueByTagname(ResponseName, JsonTagName)** | ||
- | * Description: If the content of the response to a request is JSON, this function allows to retrieve all the values of the element linked to the tagName as an array of values represented with a tastRowValues object. The result is presented with the values separated by the character |, in the field Message / Result / Value. | + | * Description: if the content of the response to a request is JSON, this function allows to retrieve all the values of the element linked to the tagName as an array of values represented with a tastRowValues object. The result is presented with the values separated by the character |, in the field Message / Result / Value. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
- | * JSonTagName: Tagname expression used to identify the element. | + | * JSonTagName: tagname expression used to identify the element. |
* **getALLXMLElementValueByTagName(StepResponse, ElementTag)** | * **getALLXMLElementValueByTagName(StepResponse, ElementTag)** | ||
- | * Description: If the content of the response to a request is XML, this function allows to retrieve all the values of the element linked to the tagName as an array of values represented with a tastRowValues object. Instead of returning only one element (the first), this PF returns a list of all elements. | + | * Description: if the content of the response to a request is XML, this function allows to retrieve all the values of the element linked to the tagName as an array of values represented with a tastRowValues object. Instead of returning only one element (the first), this PF returns a list of all elements. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
* ElementTag: XML´s tag used to identify the element. | * ElementTag: XML´s tag used to identify the element. | ||
* **getCookieValue(StepResponse, Cookie)** | * **getCookieValue(StepResponse, Cookie)** | ||
- | * Description: Retrieve the value of the indicated cookie. | + | * Description: retrieve the value of the indicated cookie. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
- | * Cookie: Indicates Cookie´s name to retrieve. | + | * Cookie: indicates Cookie´s name to retrieve. |
- | * **getElementsCountByJsonPath(JsonPath, ResponseName)**: Returns the number of elements that have the same JsonPath. | + | * **getElementsCountByJsonPath(JsonPath, ResponseName)**: returns the number of elements that have the same JsonPath. |
- | * JsonPath: The JsonPath to search for. | + | * JsonPath: the JsonPath to search for. |
- | * ResponseName: The name under which the HTTP response was generated. | + | * ResponseName: the name under which the HTTP response was generated. |
| | ||
- | * **getElementsCountByTagName(tagName, ResponseName)**: Returns the number of elements that have the same tag name. | + | * **getElementsCountByTagName(tagName, ResponseName)**: returns the number of elements that have the same tag name. |
- | * tagName: The tag name to search for. | + | * tagName: the tag name to search for. |
- | * ResponseName: The name under which the HTTP response was generated. | + | * ResponseName: the name under which the HTTP response was generated. |
- | * **getElementsValueByJsonPath(JsonPath, ResponseName)**: Returns all elements that have the same JsonPath. | + | * **getElementsValueByJsonPath(JsonPath, ResponseName)**: returns all elements that have the same JsonPath. |
- | * JsonPath: The JsonPath to search. | + | * JsonPath: the JsonPath to search. |
- | * ResponseName: The name under which the HTTP response was generated. | + | * ResponseName: the name under which the HTTP response was generated. |
* **getHeaderValue(StepResponse, Header)** | * **getHeaderValue(StepResponse, Header)** | ||
- | * Description: It allows to obtain the value of a received header in an HTTP response. | + | * Description: it allows to obtain the value of a received header in an HTTP response. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
- | * Header: The name of the header from which you want to extract the value. | + | * Header: the name of the header from which you want to extract the value. |
* **getHTMLElementValueByXpath()**\\ | * **getHTMLElementValueByXpath()**\\ | ||
- | * Description: If the content of the response to a request is HTML, this function allows to retrieve a value of an element, using to identify the element an XPath expression. | + | * Description: if the content of the response to a request is HTML, this function allows to retrieve a value of an element, using to identify the element an XPath expression. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
* XPathExp: XPath expression used to identify the element. | * XPathExp: XPath expression used to identify the element. | ||
* **getJSONElementValueByJsonPath(StepResponse, JSonPathExp)** | * **getJSONElementValueByJsonPath(StepResponse, JSonPathExp)** | ||
- | * Description: If the content of the response to a request is JSON, this function allows to retrieve a value of an element used to identify the element the JsonPath. If there are more than one element, returns the first. | + | * Description: if the content of the response to a request is JSON, this function allows to retrieve a value of an element used to identify the element the JsonPath. If there are more than one element, returns the first. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
* JSonPathExp: JSonPath expression used to identify the element. | * JSonPathExp: JSonPath expression used to identify the element. | ||
* **getJSONElementValueByTagName(StepResponse, TagnameExp)** | * **getJSONElementValueByTagName(StepResponse, TagnameExp)** | ||
- | * Description: If the content of the response to a request is JSON, this function allows to retrieve a value of an element used to identify the element the TagName. If there are more than one element, returns the first. The result is presented with the values separated by the character |, in the field Message / Result / Value. | + | * Description: if the content of the response to a request is JSON, this function allows to retrieve a value of an element used to identify the element the TagName. If there are more than one element, returns the first. The result is presented with the values separated by the character |, in the field Message / Result / Value. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
- | * JSonTagname: Tagname expression used to identify the element. | + | * JSonTagname: tagname expression used to identify the element. |
* **getResponseBody**: | * **getResponseBody**: | ||
* **getResponseStatus(StepResponse)** | * **getResponseStatus(StepResponse)** | ||
- | * Description: Allows to retrieve response´s Http status code. | + | * Description: allows to retrieve response´s Http status code. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
- | * **getResponseTime**: Returns the time taken in milliseconds to receive the response to a request. To identify the response it receives a parameter with the name of the HttpResponse variable from which we want to obtain the information. | + | * **getResponseTime**: returns the time taken in milliseconds to receive the response to a request. To identify the response it receives a parameter with the name of the HttpResponse variable from which we want to obtain the information. |
* **getRest(resource, headers, parameters)** | * **getRest(resource, headers, parameters)** | ||
- | * Description: It allows to configure an HTTP request of type Get. | + | * Description: it allows to configure an HTTP request of type Get. |
- | * Resource: Indicates the resource within the EndPoint on which the request will be made. | + | * Resource: indicates the resource within the EndPoint on which the request will be made. |
- | * Headers: Indicates the headers that must be added to the request. | + | * Headers: indicates the headers that must be added to the request. |
- | * Parameters: Indicates the parameters that must be added to the URL of the request. | + | * Parameters: indicates the parameters that must be added to the URL of the request. |
- | * Charset: To choose what charset the user wants. | + | * Charset: to choose what charset the user wants. |
* **getXMLElementValueByTagName(StepResponse, ElementTag)** | * **getXMLElementValueByTagName(StepResponse, ElementTag)** | ||
- | * Description: If the content of the response to a request is XML, this function allows to retrieve a value of an element using the tag to identify it. If there are more than one element, returns the first. | + | * Description: if the content of the response to a request is XML, this function allows to retrieve a value of an element using the tag to identify it. If there are more than one element, returns the first. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
* ElementTag: XML´s tag used to identify the element. | * ElementTag: XML´s tag used to identify the element. | ||
* **getXMLElementValueByXPath(StepResponse, XPathExp)** | * **getXMLElementValueByXPath(StepResponse, XPathExp)** | ||
- | * Description: If the content of the response to a request is XML, this function allows to retrieve a value of an element, using to identify the element an XPath expression. Also, it allows to search values in responses with XHTML content type. | + | * Description: if the content of the response to a request is XML, this function allows to retrieve a value of an element, using to identify the element an XPath expression. Also, it allows to search values in responses with XHTML content type. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
* XPathExp: XPath expression used to identify the element. | * XPathExp: XPath expression used to identify the element. | ||
* **patchRest(resource, headers, content-type, body)** | * **patchRest(resource, headers, content-type, body)** | ||
- | * Description: It allows you to configure an HTTP request of type Patch. | + | * Description: it allows you to configure an HTTP request of type Patch. |
- | * Resource: Indicates the resource within the EndPoint on which the request will be made. | + | * Resource: indicates the resource within the EndPoint on which the request will be made. |
- | * Headers: Indicates the headers that must be added to the request. | + | * Headers: indicates the headers that must be added to the request. |
* Content-type: HTTP standard header that indicates the type of content that is added to the body of the request. | * Content-type: HTTP standard header that indicates the type of content that is added to the body of the request. | ||
- | * Body: Content of the Http request. | + | * Body: content of the Http request. |
* **postRest(resource, headers, content-type, body)** | * **postRest(resource, headers, content-type, body)** | ||
- | * Description: It allows you to configure an HTTP request of type Post. | + | * Description: it allows you to configure an HTTP request of type Post. |
- | * Resource: Indicates the resource within the EndPoint on which the request will be made. | + | * Resource: indicates the resource within the EndPoint on which the request will be made. |
- | * Headers: Indicates the headers that must be added to the request. | + | * Headers: indicates the headers that must be added to the request. |
* Content-type: HTTP standard header that indicates the type of content that is added to the body of the request. | * Content-type: HTTP standard header that indicates the type of content that is added to the body of the request. | ||
- | * Body: Content of the Http request. | + | * Body: content of the Http request. |
* **putRest(resource, headers, content-type, body)** | * **putRest(resource, headers, content-type, body)** | ||
- | * Description: Allows you to configure an HTTP request of type Put. | + | * Description: allows you to configure an HTTP request of type Put. |
- | * Resource: Indicates the resource within the EndPoint on which the request will be made. | + | * Resource: indicates the resource within the EndPoint on which the request will be made. |
- | * Headers: Indicates the headers that must be added to the request. | + | * Headers: indicates the headers that must be added to the request. |
* Content-type: HTTP standard header that indicates the type of content that is added to the body of the request. | * Content-type: HTTP standard header that indicates the type of content that is added to the body of the request. | ||
- | * Body: Content of the Http request. | + | * Body: content of the Http request. |
* **responseBodyContainsText(responseName, searchValue)** | * **responseBodyContainsText(responseName, searchValue)** | ||
- | * Description: Search in the body field of the response (stepResponse), if there is any match with the string of parameter searchValue. True return if affirmative. | + | * Description: search in the body field of the response (stepResponse), if there is any match with the string of parameter searchValue. True return if affirmative. |
- | * ResponseName: Indicate the name which the Http Response was generated. | + | * ResponseName: indicate the name which the Http Response was generated. |
- | * SearchValue: Text to search inside body of response. | + | * SearchValue: text to search inside body of response. |
* **setBasicAuthentication(user, password)** | * **setBasicAuthentication(user, password)** | ||
- | * Description: It allows to configure the authentication scheme of the requests that are sent to the EndPoint as BasicAuthentication. It overwrites the security setting done in the adapter setup. | + | * Description: it allows to configure the authentication scheme of the requests that are sent to the EndPoint as BasicAuthentication. It overwrites the security setting done in the adapter setup. |
- | * User: User code used as credential. | + | * User: user code used as credential. |
- | * Password: Password to present as credential. | + | * Password: password to present as credential. |
* **setBearerTokenAuthentication(token)** | * **setBearerTokenAuthentication(token)** | ||
- | * Description: It allows to configure the authentication scheme of the requests that are send to the endpoint as Bearer Token Authentication Scheme. It overwrites the security setting done in the adapter setup. | + | * Description: it allows to configure the authentication scheme of the requests that are send to the endpoint as Bearer Token Authentication Scheme. It overwrites the security setting done in the adapter setup. |
- | * Token: Token´s value that will be presented as credential. | + | * Token: token´s value that will be presented as credential. |
* **setDigestAuthentication(user, password, realm, nonce, algorithm, Qoq, NonceCount, ClientNonce, Opaque)** | * **setDigestAuthentication(user, password, realm, nonce, algorithm, Qoq, NonceCount, ClientNonce, Opaque)** | ||
- | * Description: It allows to configure the authentication scheme of the requests that are send to the endpoint as Digest Authentication Scheme. It overwrites the security setting done in the adapter setup. | + | * Description: it allows to configure the authentication scheme of the requests that are send to the endpoint as Digest Authentication Scheme. It overwrites the security setting done in the adapter setup. |
- | * User: Username used as credential. | + | * User: username used as credential. |
- | * Password: Password to present as credential. | + | * Password: password to present as credential. |
- | * Realm: Security domain on which security validation must be performed. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. | + | * Realm: security domain on which security validation must be performed. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. |
- | * Nonce: Nonce returned by the server. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. | + | * Nonce: nonce returned by the server. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. |
- | * Algorithm: Algorithm used for encryption. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. | + | * Algorithm: algorithm used for encryption. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. |
- | * Qoq: Quality of the protection code. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. | + | * Qoq: quality of the protection code. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. |
- | * NonceCount: NonceCount associated with the request. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. | + | * NonceCount: nonceCount associated with the request. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. |
- | * ClientNonce: Nonce generated by the client. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. | + | * ClientNonce: nonce generated by the client. It is optional, if it is not known, the adapter will try to perform the validation with the data obtained from the response to the challenge. |
- | * Opaque: Opaque returned by the server. It is optional, if it is not known, the adapter will try to perform the validation with the data obtain | + | * Opaque: opaque returned by the server. It is optional, if it is not known, the adapter will try to perform the validation with the data obtain |
* **setNoneAuthentication()** | * **setNoneAuthentication()** | ||
- | * Description: It allows to configure the authentication method of the requests that are sent to the EndPoint as requests without authentication scheme. It overwrites the security setting done in the adapter setup.\\ | + | * Description: it allows to configure the authentication method of the requests that are sent to the EndPoint as requests without authentication scheme. It overwrites the security setting done in the adapter setup.\\ |
Line 179: | Line 179: | ||
Now comes the enumeration of the authentication types, make a brief description of them and think what parameters we might need. | Now comes the enumeration of the authentication types, make a brief description of them and think what parameters we might need. | ||
- | * ** No Authorization (None Auth): ** If the user selects this method, it is not necessary to authenticate to use the service. | + | * ** No Authorization (None Auth): ** if the user selects this method, it is not necessary to authenticate to use the service. |
- | * ** Basic Authorization (Basic Auth): ** The simplest method only requires the user and password parameters. https://en.wikipedia.org/wiki/Basic_access_authentication | + | * ** Basic Authorization (Basic Auth): ** the simplest method only requires the user and password parameters. https://en.wikipedia.org/wiki/Basic_access_authentication |
- | * ** Digest Authorization (Digest Auth): ** This method is a bit stronger because the key is encrypted and the user, in the postman tool when you select this type of authentication requests the following parameters:\\ \\ | + | * ** Digest Authorization (Digest Auth): ** this method is a bit stronger because the key is encrypted and the user, in the postman tool when you select this type of authentication requests the following parameters:\\ \\ |
* User | * User | ||
* Password\\ \\ And as optional (default values are used if the user does not provide them) the following:\\ \\ | * Password\\ \\ And as optional (default values are used if the user does not provide them) the following:\\ \\ | ||
- | * Realm: Security domain against which to authenticate. | + | * Realm: security domain against which to authenticate. |
- | * Algorithm: Encryption algorithm. MD5 or MD5-sess. | + | * Algorithm: encryption algorithm. MD5 or MD5-sess. |
- | * Nonce: Code that the server issues in the response when a request is not authorized. It is unique per session and must be included in the following requests. | + | * Nonce: code that the server issues in the response when a request is not authorized. It is unique per session and must be included in the following requests. |
- | * Qop: Quality of protection, the possible values are auth (more common) or auth-int (authorization with integrity) I think less supported and used. | + | * Qop: quality of protection, the possible values are auth (more common) or auth-int (authorization with integrity) I think less supported and used. |
- | * Nonce Count: Number of request made to the server with the same nonce, its obligation depends on the value assigned to Qop. | + | * Nonce Count: number of request made to the server with the same nonce, its obligation depends on the value assigned to Qop. |
- | * Opaque: It is a value returned by the server in the first unauthorized response, and must be added without modifying all subsequent requests to the server. https://en.wikipedia.org/wiki/Digest_access_authentication | + | * Opaque: it is a value returned by the server in the first unauthorized response, and must be added without modifying all subsequent requests to the server. https://en.wikipedia.org/wiki/Digest_access_authentication |
- | * ** OAuth 1.0:** This method, open Authorization, is more modern to create a first standard related to authentication. OAuth 2.0 is used more but we could find a service that uses it. In Postman the following parameters are requested:\\ \\ | + | * ** OAuth 1.0:** this method, open Authorization, is more modern to create a first standard related to authentication. OAuth 2.0 is used more but we could find a service that uses it. In Postman the following parameters are requested:\\ \\ |
- | * ConsumerKey: A value used by the consumer of the service to identify himself to it. | + | * ConsumerKey: a value used by the consumer of the service to identify himself to it. |
- | * ConsumerSecret: Token used by the consumer to validate their ownership of the ConsumerKey. | + | * ConsumerSecret: token used by the consumer to validate their ownership of the ConsumerKey. |
- | * Access Token: Access Token. | + | * Access Token: access Token. |
- | * Token Secret: Another key to ensure ownership of the access token.\\ And as optional parameters (default values if user does not enter):\\ | + | * Token Secret: another key to ensure ownership of the access token.\\ And as optional parameters (default values if user does not enter):\\ |
- | * Signature Method: The signature method used by the consumer to sign the requests. | + | * Signature Method: the signature method used by the consumer to sign the requests. |
- | * Timestamp: A timestamp is added to the request. | + | * Timestamp: a timestamp is added to the request. |
- | * Nonce: Random string generated by the client, will be added to all the requests. | + | * Nonce: random string generated by the client, will be added to all the requests. |
- | * Realm: Indicates the security domain that performs authentication. https://es.wikipedia.org/wiki/OAuth | + | * Realm: indicates the security domain that performs authentication. https://es.wikipedia.org/wiki/OAuth |
- | * ** OAuth 2.0:** The evolution of OAuth 1.0, is the standard most supported by large Internet companies, Google, Facebook, Twitter, etc., not being an expert, I believe it is two-step authentication. Postman only asks for the parameter: | + | * ** OAuth 2.0:** the evolution of OAuth 1.0, is the standard most supported by large Internet companies, Google, Facebook, Twitter, etc., not being an expert, I believe it is two-step authentication. Postman only asks for the parameter: |
* Access Token. Access code to the service. But in the option to request an Access Token request data to authenticate against the service that is going to give you the access code for that operation. In addition to these methods other authentication methods appear in Postman such as: | * Access Token. Access code to the service. But in the option to request an Access Token request data to authenticate against the service that is going to give you the access code for that operation. In addition to these methods other authentication methods appear in Postman such as: | ||
* Bearer Token. https://swagger.io/docs/specification/authentication/bearer-authentication/ | * Bearer Token. https://swagger.io/docs/specification/authentication/bearer-authentication/ |