Skip to content

Commit

Permalink
Merge pull request #3 from berlinonline/fix_flash_msg
Browse files Browse the repository at this point in the history
Enable flash messages for login errors.
  • Loading branch information
knudmoeller authored Jul 22, 2024
2 parents 3b33789 + 72cbf6f commit f23b8f3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,24 @@ on:
branches:
- '**'
jobs:
# lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: '3.6'
# - name: Install requirements
# run: pip install flake8 pycodestyle
# - name: Check syntax
# run: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude ckan

test:
# needs: lint
strategy:
matrix:
ckan-version: [2.9]
ckan-base-version: [2.9]
ckan-version: [py3.9]
solr-version: [solr8]
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
name: CKAN ${{ matrix.ckan-base-version }}
runs-on: ubuntu-latest
container:
image: openknowledge/ckan-dev:${{ matrix.ckan-version }}
image: ckan/ckan-dev:${{ matrix.ckan-base-version }}-${{ matrix.ckan-version }}
services:
solr:
image: ckan/ckan-solr-dev:${{ matrix.ckan-version }}
image: ckan/ckan-solr:${{ matrix.ckan-base-version }}-${{ matrix.solr-version }}
postgres:
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }}
image: ckan/ckan-postgres-dev:${{ matrix.ckan-base-version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -48,6 +38,8 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Install CURL
run: apt install curl -y
- name: Install requirements
run: |
pip install -r dev-requirements.txt
Expand All @@ -62,7 +54,7 @@ jobs:
pip install -e ckanext-berlin_dataset_schema
pip install -r ckanext-berlin_dataset_schema/requirements.txt
# Install ckanext-dcat
git clone https://github.com/ckan/ckanext-dcat
git clone https://github.com/ckan/ckanext-dcat -b v1.4.0
pip install -e ckanext-dcat
pip install -r ckanext-dcat/requirements.txt
- name: Setup extension (CKAN >= 2.9)
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Development

## [0.2.7](https://github.com/berlinonline/ckanext-berlinauth/releases/tag/0.2.7)

_(2024-07-22)_

- Allow flash messages for displaying errors.
- Fix github workflow.
- Allow `_debug_toolbar` asset.

## [0.2.6](https://github.com/berlinonline/ckanext-berlinauth/releases/tag/0.2.6)

_(2023-05-22)_
Expand Down
2 changes: 1 addition & 1 deletion ckanext/berlinauth/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.6
0.2.7
4 changes: 4 additions & 0 deletions ckanext/berlinauth/auth_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
USER_PROCESS_PAGES = [
'/user/login',
'/user/reset',
'/user/logged_in'
]
ASSET_PATHS = [
'/webassets',
'/base',
'/favicon.ico',
'/_debug_toolbar'
]

def public_pages():
Expand All @@ -28,6 +30,7 @@ def public_pages():
class AuthMiddleware(object):
def __init__(self, app, app_conf):
self.app = app

def __call__(self, environ, start_response):

# List of extensions to be made accessible for dcat
Expand All @@ -37,6 +40,7 @@ def __call__(self, environ, start_response):
catalog_endpoints = config.get('ckanext.dcatde_berlin.additional_endpoints', '').split() # dcatde_berlin can add additional endpoints
catalog_endpoints.append('/catalog')


# we putting only UI behind login so API paths should remain accessible
if environ['PATH_INFO'].startswith('/api/'):
return self.app(environ,start_response)
Expand Down

0 comments on commit f23b8f3

Please sign in to comment.