Skip to content

Commit

Permalink
Merge branch 'develop' into Interdependent-recovery-of-residential-bu…
Browse files Browse the repository at this point in the history
…ildings-and-households
  • Loading branch information
ylyangtw authored Aug 26, 2024
2 parents 0621278 + 2e75fe9 commit ebcfaa6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 26 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ 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
- Support Interdependent recovery of residential buildings and households [#606](https://github.com/IN-CORE/pyincore/pull/606)
- Remove unused insecure IN-CORE client [#581](https://github.com/IN-CORE/pyincore/issues/581)

### Added
- Apply Black formatter [#589](https://github.com/IN-CORE/pyincore/issues/589)
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
23 changes: 0 additions & 23 deletions pyincore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,26 +451,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

0 comments on commit ebcfaa6

Please sign in to comment.