Skip to content

Commit

Permalink
remove insecure client
Browse files Browse the repository at this point in the history
  • Loading branch information
longshuicy committed Jun 24, 2024
1 parent 4f91a29 commit 6ab9895
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 25 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [Unreleased]

### Changed
- Remove unused insecure IN-CORE client [#581](https://github.com/IN-CORE/pyincore/issues/581)


## [1.19.0] - 2024-06-12

### Changed
Expand Down
2 changes: 0 additions & 2 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,6 @@ client
:members:
.. autoclass:: client.IncoreClient
:members:
.. autoclass:: client.InsecureIncoreClient
:members:

dataservice
===========
Expand Down
1 change: 0 additions & 1 deletion pyincore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# The order of import matters. You need to import module by order of dependency
from pyincore.client import Client
from pyincore.client import IncoreClient
from pyincore.client import InsecureIncoreClient
from pyincore.hazardservice import HazardService
from pyincore.utils.expressioneval import Parser
from pyincore.utils.cge_ml_file_util import CGEMLFileUtil
Expand Down
21 changes: 0 additions & 21 deletions pyincore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,24 +422,3 @@ def clear_cache(self):
# clear entry from service.json
update_hash_entry("edit", hashed_url=self.hashed_service_url)
return


class InsecureIncoreClient(Client):
"""IN-CORE service client class that bypasses Ambassador auth. It contains token and service root url.
Args:
service_url (str): Service url.
username (str): Username string.
"""

def __init__(self, service_url: str = None, username: str = None):
super().__init__()
if service_url is None or len(service_url.strip()) == 0:
service_url = pyglobals.INCORE_API_PROD_URL
self.service_url = service_url
if username is None or len(username.strip()) == 0:
self.session.headers["x-auth-userinfo"] = pyglobals.INCORE_LDAP_TEST_USER_INFO
else:
user_info = "{\"preferred_username\": \"" + username + "\"}"
self.session.headers["x-auth-userinfo"] = user_info
2 changes: 1 addition & 1 deletion tests/pyincore/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pytest
import requests

from pyincore import Client, IncoreClient, InsecureIncoreClient, DataService
from pyincore import Client, IncoreClient, DataService


def test_client_success(monkeypatch):
Expand Down

0 comments on commit 6ab9895

Please sign in to comment.