diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore index ca662dad..f27eb6c3 100644 --- a/.swagger-codegen-ignore +++ b/.swagger-codegen-ignore @@ -26,3 +26,4 @@ tox.ini test-requirements.txt setup.py +requirements.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 49d1dbd2..19d7a279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ [1]: https://pypi.org/project/demisto-py/#history +## 2.0.5 +Remove unsupported user/password authentication option. + ## 2.0.4 Fix missing dependency (tzlocal). diff --git a/README.md b/README.md index 94750158..4bc76408 100644 --- a/README.md +++ b/README.md @@ -28,20 +28,6 @@ api_instance = demisto_client.configure(base_url=host, api_key=api_key) ``` -**Alternatively, you can login with username and password:** - -```python -import demisto_client - -host = 'https://YOUR_DEMISTO_HOST' -username = 'YOUR_USERNAME' -password = 'YOUR_PASSWORD' - -api_instance = demisto_client.configure(base_url=host, username=username, password=password) - -``` - - ### 3. Create incidents ```python diff --git a/demisto_client/__init__.py b/demisto_client/__init__.py index ec76e249..66dd2d81 100644 --- a/demisto_client/__init__.py +++ b/demisto_client/__init__.py @@ -16,25 +16,20 @@ __version__ = 'dev' -def configure(base_url=None, api_key=None, username=None, password=None, verify_ssl=True, proxy=None, +def configure(base_url=None, api_key=None, verify_ssl=True, proxy=None, debug=False): """ This wrapper provides an easier to use method of configuring the API client. The base Configuration method is still exposed if you wish to further configure the API Client. - To avoid hard coding configurations in your code, it is also possible to specify api_key, username, password + To avoid hard coding configurations in your code, it is also possible to specify api_key and base_url as the following environment variables (env variables will be used if parameters are not specified): * DEMISTO_BASE_URL * DEMISTO_API_KEY - * DEMISTO_USERNAME - * DEMISTO_PASSWORD - + :param base_url: str - Base url of your Demisto instance. :param api_key: str - API key generated by your instance. - :param username: str - If using credentials to authenticate, provide username of account. - :param password: str - If using credentials to authenticate, provide password for the account. - Please note: headers are not encrypted. :param verify_ssl: bool - Indicates if valid SSLs are required for connection. :param proxy: dict - Dict object of your proxy settings. :param debug: bool - Include verbose logging. @@ -43,15 +38,13 @@ def configure(base_url=None, api_key=None, username=None, password=None, verify_ configuration = Configuration() configuration.api_key['Authorization'] = api_key or os.getenv('DEMISTO_API_KEY', None) configuration.host = base_url or os.getenv('DEMISTO_BASE_URL', None) - configuration.username = username or os.getenv('DEMISTO_USERNAME', None) - configuration.password = password or os.getenv('DEMISTO_PASSWORD', None) configuration.verify_ssl = verify_ssl configuration.proxy = proxy configuration.debug = debug if not configuration.host: raise ValueError('You must specify base_url either as a parameter or via env variable: DEMISTO_BASE_URL') - if not configuration.api_key.get('Authorization', None) and not (configuration.username and configuration.password): - raise ValueError('You must specify either api_key or username/password either as parameters or env variables') + if not configuration.api_key.get('Authorization', None): + raise ValueError('You must specify either api_key as parameters or via env variable: DEMISTO_API_KEY') api_client = ApiClient(configuration) api_client.user_agent = 'demisto-py/' + __version__ api_instance = demisto_api.DefaultApi(api_client) diff --git a/demisto_client/demisto_api/api/default_api.py b/demisto_client/demisto_api/api/default_api.py index 5bf1a817..ff07ddc1 100644 --- a/demisto_client/demisto_api/api/default_api.py +++ b/demisto_client/demisto_api/api/default_api.py @@ -3806,7 +3806,7 @@ def incident_file_upload(self, id, file, **kwargs): # noqa: E501 :param file file: file (required) :param str file_name: file name :param str file_comment: file comment - :param str field: field name to hold the attachment details. If not sepcified `attachment` will be used. + :param str field: field name to hold the attachment details. If not specified, `attachment` will be used. :param bool show_media_file: show media file :param bool last: If set to true will create an investigation. Used for uploading after creating incident. :return: IncidentWrapper @@ -3834,7 +3834,7 @@ def incident_file_upload_with_http_info(self, id, file, **kwargs): # noqa: E501 :param file file: file (required) :param str file_name: file name :param str file_comment: file comment - :param str field: field name to hold the attachment details. If not sepcified `attachment` will be used. + :param str field: field name to hold the attachment details. If not specified, `attachment` will be used. :param bool show_media_file: show media file :param bool last: If set to true will create an investigation. Used for uploading after creating incident. :return: IncidentWrapper diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 46a232fd..760817b7 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -1917,7 +1917,7 @@ id = 'id_example' # str | Incident id to update file = '/path/to/file.txt' # file | file file_name = 'file_name_example' # str | file name (optional) file_comment = 'file_comment_example' # str | file comment (optional) -field = 'field_example' # str | field name to hold the attachment details. If not sepcified `attachment` will be used. (optional) +field = 'field_example' # str | field name to hold the attachment details. If not specified, `attachment` will be used. (optional) show_media_file = true # bool | show media file (optional) last = true # bool | If set to true will create an investigation. Used for uploading after creating incident. (optional) @@ -1936,7 +1936,7 @@ Name | Type | Description | Notes **file** | **file**| file | **file_name** | **str**| file name | [optional] **file_comment** | **str**| file comment | [optional] - **field** | **str**| field name to hold the attachment details. If not sepcified `attachment` will be used. | [optional] + **field** | **str**| field name to hold the attachment details. If not specified, `attachment` will be used. | [optional] **show_media_file** | **bool**| show media file | [optional] **last** | **bool**| If set to true will create an investigation. Used for uploading after creating incident. | [optional] diff --git a/gen-code.sh b/gen-code.sh index d62ab5cd..d85c5737 100755 --- a/gen-code.sh +++ b/gen-code.sh @@ -43,7 +43,7 @@ sed -i '' -e 's/^## Author//g' docs/README.md # add ability for generic requests sed -i '' -e 's/import six/import six\ import demisto_client/g' demisto_client/demisto_api/api/default_api.py -echo -e "\n def generic_request(self, path, method, body=None, **kwargs): # noqa: E501\n return demisto_client.generic_request_func(self, path, method, body=None, **kwargs)" >> demisto_client/demisto_api/api/default_api.py +echo -e "\n def generic_request(self, path, method, body=None, **kwargs): # noqa: E501\n return demisto_client.generic_request_func(self, path, method, body, **kwargs)" >> demisto_client/demisto_api/api/default_api.py # remove files not used rm .travis.yml