Skip to content

Commit

Permalink
Release 1.7.1 (#111)
Browse files Browse the repository at this point in the history
- Use Layman Test Client v1.3.0
- Handle records without title in GET Layers / GET Maps, fix #109
- Return real SLD style in GET Layer Style instead of just metadata
  • Loading branch information
jirik authored Sep 30, 2020
1 parent 74063c5 commit 40561c9
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .env.demo
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ LAYMAN_CLIENT_URL=http://layman_client:3000/client/

# client
LAYMAN_CLIENT_PUBLIC_URL=http://localhost/client/
LAYMAN_CLIENT_VERSION=v1.2.0
LAYMAN_CLIENT_VERSION=v1.3.0

# extra hosts to be added to /etc/hosts
EXTRA_HOST1=1.2.3.4:1.2.3.4
Expand Down
2 changes: 1 addition & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ LAYMAN_CLIENT_URL=http://layman_client:3000/client/

# client
LAYMAN_CLIENT_PUBLIC_URL=http://localhost:3000/client/
LAYMAN_CLIENT_VERSION=v1.2.0
LAYMAN_CLIENT_VERSION=v1.3.0


##############################################################################
Expand Down
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ LAYMAN_CLIENT_URL=http://layman_client_test:3000/client/

# client
LAYMAN_CLIENT_PUBLIC_URL=http://layman_test_run_1:8000/client/
LAYMAN_CLIENT_VERSION=v1.2.0
LAYMAN_CLIENT_VERSION=v1.3.0


##############################################################################
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# Changelog

## v1.7.1
2020-09-30
### Upgrade requirements
- Change [LAYMAN_CLIENT_VERSION](doc/env-settings.md#LAYMAN_CLIENT_VERSION) to `v1.3.0`
- If you are running Layman with development settings, run also `make client-build`.
### Changes
- Test Client contains also GET Layer Style endpoint.
- Return real SLD style in GET Layer Style instead of just metadata
- [#109](https://github.com/jirik/layman/issues/109) Handle records without title in GET Layers / GET Maps

## v1.7.0
2020-09-30
### Upgrade requirements
- [#65](https://github.com/jirik/layman/issues/65) Set environment variable [LAYMAN_GS_AUTHN_HTTP_HEADER_ATTRIBUTE](doc/env-settings.md#LAYMAN_GS_AUTHN_HTTP_HEADER_ATTRIBUTE). Only combination of lowercase characters and numbers must be used for the value.
- [#101](https://github.com/jirik/layman/issues/101) Change [LAYMAN_CLIENT_VERSION](doc/env-settings.md#LAYMAN_CLIENT_VERSION) from `v1.1.2` to `v1.2.0`
- If you are running Layman with development settings, run also `make client-build`.
### Changes
- [#65](https://github.com/jirik/layman/issues/65) [WFS endpoint](doc/rest.md#get-layer) accepts same [authentication](doc/security.md#authentication) credentials (e.g. [OAuth2 headers](doc/oauth2/index.md#request-layman-rest-api)) as Layman REST API endpoints. It's implemented using Layman's WFS proxy. This proxy authenticates the user and send user identification to GeoServer. In combination with changes in v1.6.0, Layman's [`read-everyone-write-owner` authorization](doc/security.md#authorization) (when active) is propagated to GeoServer and user can change only hers layers.
- [#88](https://github.com/jirik/layman/issues/88) Attribute **title** was added to REST endpoints [GET Layers](doc/rest.md#get-layers) and [GET Maps](doc/rest.md#get-maps).
Expand Down
10 changes: 7 additions & 3 deletions src/layman/layer/geoserver/sld.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
from layman import settings, patch_mode
from layman.common import util as layman_util
from . import headers_json
from . import headers_json, headers_xml
from . import wms
from ...util import url_for

PATCH_MODE = patch_mode.DELETE_IF_DEPENDANT

headers_sld = {
'Accept': 'application/vnd.ogc.sld+xml',
'Content-type': 'application/xml',
}


def update_layer(username, layername, layerinfo):
pass
Expand Down Expand Up @@ -57,7 +61,7 @@ def delete_layer(username, layername):


def get_layer_info(username, layername):
r = get_style_response(username, layername, headers_xml, settings.LAYMAN_GS_AUTH)
r = get_style_response(username, layername, headers_sld, settings.LAYMAN_GS_AUTH)
if r.status_code == 200:
url = url_for('rest_layer_style.get', username=username, layername=layername)
info = {
Expand Down Expand Up @@ -181,7 +185,7 @@ def get_metadata_comparison(username, layername):

def get_style_response(username, stylename, headers=None, auth=None):
if headers is None:
headers = headers_xml
headers = headers_sld
url = settings.LAYMAN_GS_REST + f'workspaces/{username}/styles/{stylename}'

r = requests.get(url,
Expand Down
8 changes: 1 addition & 7 deletions src/layman/layer/rest_layer_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@

bp = Blueprint('rest_layer_style', __name__)

headers_xml = {
'Accept': 'application/xml',
'Content-type': 'application/xml',
}


@bp.before_request
@authenticate
Expand All @@ -31,8 +26,7 @@ def get(username, layername):

response = sld.get_style_response(username,
layername,
headers_xml,
settings.LAYMAN_GS_AUTH)
auth=settings.LAYMAN_GS_AUTH)

excluded_headers = ['content-encoding', 'content-length', 'transfer-encoding', 'connection']
headers = {key: value for (key, value) in response.headers.items() if key.lower() not in excluded_headers}
Expand Down
2 changes: 1 addition & 1 deletion src/layman/layer/rest_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get(username):
infos = [
{
'name': info["name"],
'title': info["title"],
'title': info.get("title", None),
'url': url_for('rest_layer.get', layername=name, username=username),
'uuid': info["uuid"],
}
Expand Down
2 changes: 1 addition & 1 deletion src/layman/map/rest_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get(username):
infos = [
{
'name': name,
'title': info['title'],
'title': info.get("title", None),
'url': url_for('rest_map.get', mapname=name, username=name),
'uuid': info['uuid'],
}
Expand Down

0 comments on commit 40561c9

Please sign in to comment.