Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast-forward master branch to where develop branch is #304

Merged
merged 6 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build-push-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and publish a container image

on:
push:
branches:
- "develop"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# For backwards compatibility, prefix branch tags with `refs-heads-`
tags: |
type=ref,event=branch,prefix=refs-heads-

# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
# Build only the `production` target from Dockerfile
target: production
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 8 additions & 0 deletions auth_backends/helsinki_tunnus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from auth_backends.helsinki_tunnistus_suomifi import HelsinkiTunnistus


class HelsinkiTunnus(HelsinkiTunnistus):
"""A subclass of HelsinkiTunnistus that only changes the name

New backend is needed to have a second client in Helsinki tunnistus Keycloak"""
name = 'helsinki_tunnus'
12 changes: 12 additions & 0 deletions helsinki_theme/static/css/helsinki_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ $fa-font-path: "../fonts/font-awesome";
background-size: 85%;
}

.fa-helsinki_tunnus {
&:before {
content: $fa-var-envelope-o;
}
}

.login-method.login-method-yletunnus a.btn.btn-social {
background-color: #00b4c8;
border-color: #00b4c8;
Expand Down Expand Up @@ -147,3 +153,9 @@ $fa-font-path: "../fonts/font-awesome";
background-color: #ffffff;
border-color: #dddddd;
}

.login-method.login-method-helsinki_tunnus a.btn.btn-social {
color: #1a1a1a;
background-color: $hel-gold;
border-color: $hel-gold;
}
7 changes: 4 additions & 3 deletions requirements-prod.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#
# This file is autogenerated by pip-compile
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile requirements-prod.in
#
uwsgi==2.0.18 # via -r requirements-prod.in
uwsgi==2.0.22
# via -r requirements-prod.in
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

asgiref==3.4.1
# via django
certifi==2022.12.7
certifi==2023.7.22
# via requests
cffi==1.14.4
# via cryptography
Expand All @@ -18,7 +18,7 @@ coreapi==2.3.3
# via -r requirements.in
coreschema==0.0.4
# via coreapi
cryptography==40.0.1
cryptography==41.0.3
# via
# -r requirements.in
# jwcrypto
Expand All @@ -31,7 +31,7 @@ defusedxml==0.5.0
# social-auth-core
deprecated==1.2.13
# via jwcrypto
django==3.2.19
django==3.2.21
# via
# -r requirements.in
# django-appconf
Expand Down
13 changes: 13 additions & 0 deletions tunnistamo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
# Client secret
SOCIAL_AUTH_HELTUNNISTUSSUOMIFI_SECRET=(str, ""),

SOCIAL_AUTH_HELSINKI_TUNNUS_OIDC_ENDPOINT=(str, ""),
SOCIAL_AUTH_HELSINKI_TUNNUS_KEY=(str, ""),
SOCIAL_AUTH_HELSINKI_TUNNUS_SECRET=(str, ""),

SOCIAL_AUTH_ESPOO_ADFS_KEY=(str, ""),
SOCIAL_AUTH_ESPOO_ADFS_SECRET=(str, ""),

Expand Down Expand Up @@ -206,6 +210,7 @@
'auth_backends.adfs.helsinki_library_asko.HelsinkiLibraryAskoADFS',
'auth_backends.helsinki_username.HelsinkiUsername',
'auth_backends.helsinki_tunnistus_suomifi.HelsinkiTunnistus',
'auth_backends.helsinki_tunnus.HelsinkiTunnus',
'yletunnus.backends.YleTunnusOAuth2',
'django.contrib.auth.backends.ModelBackend',
'auth_backends.suomifi.SuomiFiSAMLAuth',
Expand Down Expand Up @@ -552,6 +557,14 @@
SOCIAL_AUTH_HELTUNNISTUSSUOMIFI_REDIRECT_LOGOUT_TO_END_SESSION = True
SOCIAL_AUTH_HELTUNNISTUSSUOMIFI_ON_AUTH_ERROR_REDIRECT_TO_CLIENT = True

SOCIAL_AUTH_HELSINKI_TUNNUS_OIDC_ENDPOINT = env("SOCIAL_AUTH_HELSINKI_TUNNUS_OIDC_ENDPOINT")
SOCIAL_AUTH_HELSINKI_TUNNUS_KEY = env("SOCIAL_AUTH_HELSINKI_TUNNUS_KEY")
SOCIAL_AUTH_HELSINKI_TUNNUS_SECRET = env("SOCIAL_AUTH_HELSINKI_TUNNUS_SECRET")
# Helsinki Tunnistus (Keycloak) sets the uuid for easier migration
SOCIAL_AUTH_HELSINKI_TUNNUS_USER_FIELDS = ['username', 'email', 'uuid']
SOCIAL_AUTH_HELSINKI_TUNNUS_REDIRECT_LOGOUT_TO_END_SESSION = True
SOCIAL_AUTH_HELSINKI_TUNNUS_ON_AUTH_ERROR_REDIRECT_TO_CLIENT = True

SOCIAL_AUTH_YLETUNNUS_APP_ID = env("SOCIAL_AUTH_YLETUNNUS_APP_ID")
SOCIAL_AUTH_YLETUNNUS_APP_KEY = env("SOCIAL_AUTH_YLETUNNUS_APP_KEY")
SOCIAL_AUTH_YLETUNNUS_SECRET = env("SOCIAL_AUTH_YLETUNNUS_SECRET")
Expand Down
18 changes: 18 additions & 0 deletions users/migrations/0033_alter_loginmethod_provider_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.19 on 2023-09-26 10:34

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('users', '0032_add_vakehyvaazuread_to_loginmethod_provider_id_choices'),
]

operations = [
migrations.AlterField(
model_name='loginmethod',
name='provider_id',
field=models.CharField(choices=[('eduhelfi', 'eduhelfi'), ('espoo', 'espoo'), ('espooazuread', 'espooazuread'), ('facebook', 'facebook'), ('github', 'github'), ('google', 'google'), ('helsinki_adfs', 'helsinki_adfs'), ('helsinki_library_asko_adfs', 'helsinki_library_asko_adfs'), ('helsinki_tunnus', 'helsinki_tunnus'), ('helsinkiazuread', 'helsinkiazuread'), ('heltunnistussuomifi', 'heltunnistussuomifi'), ('helusername', 'helusername'), ('suomifi', 'suomifi'), ('tunnistamo', 'tunnistamo'), ('vakehyvaazuread', 'vakehyvaazuread'), ('vantaaazuread', 'vantaaazuread'), ('yletunnus', 'yletunnus')], max_length=50, unique=True),
),
]
Loading