Skip to content

Commit

Permalink
Merge pull request #161 from gicait/dev
Browse files Browse the repository at this point in the history
got auth multiple val error #160
  • Loading branch information
iamtekson authored Jul 25, 2024
2 parents c42c389 + e1eec9d commit dff1618
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions geo/Geoserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def get_datastores(self, workspace: Optional[str] = None):
url = "{}/rest/workspaces/{}/datastores.json".format(
self.service_url, workspace
)
r = self._requests("get", url, auth=(self.username, self.password))
r = self._requests("get", url)
if r.status_code == 200:
return r.json()
else:
Expand Down Expand Up @@ -536,7 +536,7 @@ def get_coveragestores(self, workspace: str = None):
workspace = "default"

url = "{}/rest/workspaces/{}/coveragestores".format(self.service_url, workspace)
r = self._requests("get", url, auth=(self.username, self.password))
r = self._requests("get", url)
if r.status_code == 200:
return r.json()
else:
Expand Down Expand Up @@ -725,7 +725,7 @@ def get_layers(self, workspace: Optional[str] = None):

if workspace is not None:
url = "{}/rest/workspaces/{}/layers".format(self.service_url, workspace)
r = self._requests("get", url, auth=(self.username, self.password))
r = self._requests("get", url)
if r.status_code == 200:
return r.json()
else:
Expand Down Expand Up @@ -790,7 +790,7 @@ def get_layergroups(self, workspace: Optional[str] = None):
url = "{}/rest/workspaces/{}/layergroups".format(
self.service_url, workspace
)
r = self._requests("get", url, auth=(self.username, self.password))
r = self._requests("get", url)
if r.status_code == 200:
return r.json()
else:
Expand Down Expand Up @@ -1474,7 +1474,7 @@ def get_styles(self, workspace: Optional[str] = None):
url = "{}/rest/workspaces/{}/styles.json".format(
self.service_url, workspace
)
r = self._requests("get", url, auth=(self.username, self.password))
r = self._requests("get", url)
if r.status_code == 200:
return r.json()
else:
Expand Down Expand Up @@ -2752,7 +2752,7 @@ def get_featuretypes(self, workspace: str = None, store_name: str = None) -> Lis
url = "{}/rest/workspaces/{}/datastores/{}/featuretypes.json".format(
self.service_url, workspace, store_name
)
r = self._requests("get", url, auth=(self.username, self.password))
r = self._requests("get", url)
if r.status_code == 200:
r_dict = r.json()
features = [i["name"] for i in r_dict["featureTypes"]["featureType"]]
Expand Down Expand Up @@ -2788,7 +2788,7 @@ def get_feature_attribute(
url = "{}/rest/workspaces/{}/datastores/{}/featuretypes/{}.json".format(
self.service_url, workspace, store_name, feature_type_name
)
r = self._requests("get", url, auth=(self.username, self.password))
r = self._requests("get", url)
if r.status_code == 200:
r_dict = r.json()
attribute = [
Expand Down Expand Up @@ -2822,7 +2822,7 @@ def get_featurestore(self, store_name: str, workspace: str) -> dict:
url = "{}/rest/workspaces/{}/datastores/{}".format(
self.service_url, workspace, store_name
)
r = self._requests("get", url, auth=(self.username, self.password))
r = self._requests("get", url)
if r.status_code == 200:
r_dict = r.json()
return r_dict["dataStore"]
Expand Down Expand Up @@ -2858,7 +2858,7 @@ def delete_featurestore(
)
if workspace is None:
url = "{}/datastores/{}".format(self.service_url, featurestore_name)
r = self._requests("delete", url, auth=(self.username, self.password), params=payload)
r = self._requests("delete", url, params=payload)

if r.status_code == 200:
return "Status code: {}, delete featurestore".format(r.status_code)
Expand Down Expand Up @@ -2898,7 +2898,7 @@ def delete_coveragestore(
self.service_url, coveragestore_name
)

r = self._requests("delete", url, auth=(self.username, self.password), params=payload)
r = self._requests("delete", url, params=payload)

if r.status_code == 200:
return "Coverage store deleted successfully"
Expand Down Expand Up @@ -2937,7 +2937,7 @@ def get_all_users(self, service=None) -> dict:
url += "service/{}/users/".format(service)

headers = {"accept": "application/xml"}
r = self._requests("get", url, auth=(self.username, self.password), headers=headers)
r = self._requests("get", url, headers=headers)

if r.status_code == 200:
return parse(r.content)
Expand Down Expand Up @@ -3073,7 +3073,7 @@ def delete_user(self, username: str, service=None) -> str:
url += "service/{}/user/{}".format(service, username)

headers = {"accept": "application/json"}
r = self._requests("delete", url, auth=(self.username, self.password), headers=headers)
r = self._requests("delete", url, headers=headers)

if r.status_code == 200:
return "User deleted successfully"
Expand Down Expand Up @@ -3105,7 +3105,7 @@ def get_all_usergroups(self, service=None) -> dict:
else:
url += "service/{}/groups/".format(service)

r = self._requests("get", url, auth=(self.username, self.password))
r = self._requests("get", url)

if r.status_code == 200:
return parse(r.content)
Expand Down Expand Up @@ -3138,7 +3138,7 @@ def create_usergroup(self, group: str, service=None) -> str:
url += "group/{}".format(group)
else:
url += "service/{}/group/{}".format(service, group)
r = self._requests("post", url, auth=(self.username, self.password))
r = self._requests("post", url)

if r.status_code == 201:
return "Group created successfully"
Expand Down Expand Up @@ -3172,7 +3172,7 @@ def delete_usergroup(self, group: str, service=None) -> str:
else:
url += "service/{}/group/{}".format(service, group)

r = self._requests("delete", url, auth=(self.username, self.password))
r = self._requests("delete", url)

if r.status_code == 200:
return "Group deleted successfully"
Expand Down
2 changes: 1 addition & 1 deletion geo/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__author__ = "Tek Kshetri"
__email__ = "iamtekson@gmail.com"
__version__ = "2.8.0"
__version__ = "2.8.1"

0 comments on commit dff1618

Please sign in to comment.