Skip to content

Commit

Permalink
Merge pull request #22 from EOEPCA/release/v0.3
Browse files Browse the repository at this point in the history
Release/v0.3
  • Loading branch information
TiagoMF20 authored Jan 12, 2021
2 parents 1b81b35 + bd43aaa commit 9fe91c8
Show file tree
Hide file tree
Showing 38 changed files with 2,252 additions and 45 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ jobs:
- stage: container creation and publishing
install: skip
script: travis/containerCreation.sh um-user-profile

- stage: Static Code Analysis
language: java
if: branch = develop
before_install:
- wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip
- unzip sonar-scanner-cli-3.3.0.1492-linux.zip -d /tmp
script: /tmp/sonar-scanner-3.3.0.1492-linux/bin/sonar-scanner -Dsonar.projectKey=$SONARQUBE_PROJECT_KEY -Dsonar.sources=. -Dsonar.host.url=$SONARQUBE_URL -Dsonar.login=$SONAR_TOKEN


- stage: smoke and acceptance test
install: skip # without this there's a `git clone` executed!
Expand Down
24 changes: 24 additions & 0 deletions charts/user-profile/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
name: user-profile
description: A Helm chart for the User Profile
maintainers:
- name: eoepca
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.0
32 changes: 32 additions & 0 deletions charts/user-profile/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "login-service.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "login-service.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "login-service.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

41 changes: 41 additions & 0 deletions charts/user-profile/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gluu-ingress-user-profile-static

annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- host: {{ .Values.global.ep | quote }}
http:
paths:
- path: /static
backend:
serviceName: user-profile
servicePort: 5566



---


apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gluu-ingress-user-profile

annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- host: {{ .Values.global.ep | quote }}
http:
paths:
- path: /web_ui
backend:
serviceName: user-profile
servicePort: 5566
14 changes: 14 additions & 0 deletions charts/user-profile/templates/pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: eoepca-user-pv-host
labels:
eoepca_type: userman
spec:
capacity:
storage: {{ .Values.persistence.dbStorageSize }}
accessModes:
- {{ .Values.persistence.accessModes }}
hostPath:
path: "/kubedata/userman"
type: {{ .Values.persistence.type }}
21 changes: 21 additions & 0 deletions charts/user-profile/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: eoepca-user-pvc
namespace: {{ .Release.Namespace }}
labels:
eoepca_type: userman
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
accessModes:
- {{ .Values.persistence.accessModes }}
capacity:
storage: {{ .Values.persistence.dbStorageSize }}
resources:
requests:
storage: {{ .Values.persistence.dbStorageSize }}
selector:
matchLabels:
eoepca_type: userman
27 changes: 27 additions & 0 deletions charts/user-profile/templates/user-cm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: user-cm
data:
UP_SSO_URL: {{ .Values.global.ssoUrl | quote }}
UP_TITLE: {{ .Values.global.title | quote }}
UP_SCOPES: {{ .Values.global.scopes | quote }}
UP_REDIRECT_URI: {{ .Values.global.redirectUri | quote }}
UP_POST_LOGOUT_REDIRECT_URI: {{ .Values.global.postLogoutRedirectUri | quote }}
UP_BASE_URI: {{ .Values.global.baseUri | quote }}
UP_OAUTH_CALLBACK_PATH: {{ .Values.global.oauthCallbackPath | quote }}
UP_LOGOUT_ENDPOINT: {{ .Values.global.logoutEndpoint | quote }}
UP_SERVICE_HOST: {{ .Values.global.serviceHost | quote }}
UP_SERVICE_PORT: {{ .Values.global.servicePort | quote }}
UP_PROTECTED_ATTRIBUTES: {{ .Values.global.protectedAttributes | quote }}
UP_BLACKLIST_ATTRIBUTES: {{ .Values.global.blacklistAttributes | quote }}
UP_SEPARATOR_UI_ATTRIBUTES: {{ .Values.global.separatorUiAttributes | quote }}
UP_COLOR_WEB_BACKGROUND: {{ .Values.global.colorWebBackground | quote }}
UP_COLOR_WEB_HEADER: {{ .Values.global.colorWebHeader | quote }}
UP_LOGO_ALT_NAME: {{ .Values.global.logoAltName | quote }}
UP_LOGO_IMAGE_PATH: {{ .Values.global.logoImagePath | quote }}
UP_COLOR_HEADER_TABLE: {{ .Values.global.colorHeaderTable | quote }}
UP_COLOR_TEXT_HEADER_TABLE: {{ .Values.global.colorTextHeaderTable | quote }}
UP_COLOR_BUTTON_MODIFY: {{ .Values.global.colorButtonModify | quote }}
UP_USE_THREADS: {{ .Values.global.useThreads | quote }}
UP_DEBUG_MODE: {{ .Values.global.debugMode | quote }}
50 changes: 50 additions & 0 deletions charts/user-profile/templates/user-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.global.user }}
labels:
app: {{ .Values.global.user }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Values.global.user }}
template:
metadata:
labels:
app: {{ .Values.global.user }}
spec:
containers:
- name: {{ .Values.global.user }}
imagePullPolicy: {{ .Values.image.imagePullPolicy }}
image: {{ .Values.image.image }}
ports:
- name: http-up
containerPort: 5566
protocol: TCP
- name: https-up
containerPort: 443
protocol: TCP
envFrom:
- configMapRef:
name: user-cm
volumeMounts:
- mountPath: /opt/user-profile/db/um-user-profile-config
subPath: um-user-profile-config
name: config-user
mountPropagation: HostToContainer
- mountPath: /opt/gluu/jetty/user-profile/logs
subPath: user-profile/logs
name: eoepca-user-pv-host

hostAliases:
- ip: {{ .Values.global.nginxIp }}
hostnames:
- {{ .Values.global.ep }}
volumes:
- name: eoepca-user-pv-host
persistentVolumeClaim:
claimName: eoepca-user-pvc
- name: config-user
configMap:
name: user-cm
20 changes: 20 additions & 0 deletions charts/user-profile/templates/user-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.global.user }}
labels:
app: {{ .Values.global.user }}
spec:
type: NodePort
ports:
- port: 5566
name: http-up
targetPort: 5566
protocol: TCP
- port: 1028
name: https-up
targetPort: 443
protocol: TCP
selector:
app: {{ .Values.global.user }}

56 changes: 56 additions & 0 deletions charts/user-profile/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Default values for login-service.

global:
nginxIp: 10.0.2.15
ssoUrl: demoexample.gluu.org
title: "EOEPCA User Profile"
scopes: "openid email user_name"
redirectUri: "http://demoexample.gluu.org/web_ui/oauth/callback"
postLogoutRedirectUri: http://demoexample.gluu.org/web_ui"
baseUri: "/web_ui"
oauthCallbackPath: "/oauth/callback"
logoutEndpoint: "/logout"
serviceHost: "0.0.0.0"
servicePort: "5566"
protectedAttributes: "userName active emails displayName value primary"
blacklistAttributes: "schemas id meta $ref"
separatorUiAttributes: "->"
colorWebBackground: "#D7EDEC"
colorWebHeader: "#FFFFFF"
logoAltName: "EOEPCA Logo"
logoImagePath: "/static/img/logo.png"
colorHeaderTable: "#38A79F"
colorTextHeaderTable: "white"
colorButtonModify: "#38A79F"
useThreads: "true"
debugMode: "true"
ep: demoexample.gluu.org
user: user-profile



image:
statefulSetReplicas: 1
imagePullPolicy: Always
image: eoepca/um-user-profile:travis_107
persistence:
accessModes: ReadWriteMany
dbStorageSize: 5Gi
type: DirectoryOrCreate

config:
enabled: true


ingress:
enabled: true
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- demoexample.gluu.org
tls:
- secretName: tls-certificate
hosts:
- demoexample.gluu.org
13 changes: 13 additions & 0 deletions docs/02.overview/00.overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ With this it will make the whole process of creating the SMPT Server connection,

The functionality related to the account removal is implemented thanks to a SCIM Client that allow querying for user information, update User Profiles based on the assignment of a specific license or in this case a account removal previously created and the two previously mentioned functionalities.

=== API Keys List

It's a feature that allows the user to modify their own list of API keys. It is implemented using the SCIM Client that allows to perform attribute modifications and checks against the Login Service OIDC Auth.

=== Licenses List

It's a feature that allows the user to modify their own list of Licenses the same way the API Keys List above is defined. It is implemented using the SCIM Client that allows to perform attribute modifications and checks against the Login Service OIDC Auth.

=== List of Terms and Conditions

It's a feature that allows the user to modify their own list of Documents of T&C the same way the API Keys List and Licenses manager above is defined. It is implemented using the SCIM Client that allows to perform attribute modifications and checks against the Login Service OIDC Auth.


== Static Architecture

[NOTE]
Expand Down
47 changes: 40 additions & 7 deletions docs/04.traceability/00.traceability.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
[[traceabilityMatrix]]
= Use Case Traceability
= User Story Traceability

[NOTE]
.Content Description
================================
This section contains:
.User Stories
|===
|Code |Description

* A traceability matrix against the use case analysis document of the project, indicating which components address each use case
|EOEPCA-165
|T&C Review Section

================================
|EOEPCA-161
|License Management Section

|EOEPCA-13
|Reusable SCIM Client Implementation

|EOEPCA-11
|Reusable OIDC Client Implementation

|EOEPCA-88
|Extend SCIM Client with UMA Protection

|EOEPCA-211
|Implementation of Helm Charts

|EOEPCA-87
|Email Notifications Hook

|EOEPCA-66
|Setup of CI/CD Configuration

|EOEPCA-24
|On-boarding Flow

|EOEPCA-21
|End-User Account Removal

|EOEPCA-20
|End-User Profile Edition/Update

|EOEPCA-164
|API Keys Management Section

|===
Binary file added images/01-login.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/02-attr.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/03-Delete.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/04-2Gluu.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/04-API.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/05-2Gluu.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/05-License.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/06-TyC.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/screenshot.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/config/WEB_config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sso_url": "demoexample.gluu.org", "title": "EOEPCA User Profile", "scopes": ["openid", "email", "user_name"], "client_id": "a434a7f5-cabc-4b75-994d-d923eb768e49", "client_id_scim": "1d6ce839-5cc4-4dda-a298-5b852a85d399", "client_secret": "XAAks9UMYAcjt7JeVgVuninIVVoQQv4W9pOkmEC4", "client_secret_scim": "876f3d24-d902-4817-9328-db650ea170c4", "redirect_uri": "http://demoexample.gluu.org:5566/web_ui/oauth/callback", "post_logout_redirect_uri": "http://demoexample.gluu.org:5566/web_ui", "base_uri": "/web_ui", "oauth_callback_path": "/oauth/callback", "logout_endpoint": "/logout", "service_host": "0.0.0.0", "service_port": 5566, "protected_attributes": ["userName", "active", "emails", "displayName", "value", "primary"], "blacklist_attributes": ["schemas", "id", "meta", "$ref"], "separator_ui_attributes": "->", "color_web_background": "#D7EDEC", "color_web_header": "#FFFFFF", "logo_alt_name": "EOEPCA Logo", "logo_image_path": "/static/img/logo.png", "color_header_table": "#38A79F", "color_text_header_table": "white", "color_button_modify": "#38A79F", "use_threads": true, "debug_mode": true}
{"sso_url": "demoexample.gluu.org", "title": "EOEPCA User Profile", "scopes": ["openid", "email", "user_name", "profile"], "client_id": "a434a7f5-cabc-4b75-994d-d923eb768e49", "client_id_scim": "1d6ce839-5cc4-4dda-a298-5b852a85d399", "client_secret": "XAAks9UMYAcjt7JeVgVuninIVVoQQv4W9pOkmEC4", "client_secret_scim": "876f3d24-d902-4817-9328-db650ea170c4", "redirect_uri": "http://demoexample.gluu.org:5566/web_ui/oauth/callback", "post_logout_redirect_uri": "http://demoexample.gluu.org:5566/web_ui", "base_uri": "/web_ui", "oauth_callback_path": "/oauth/callback", "logout_endpoint": "/logout", "service_host": "0.0.0.0", "service_port": 5566, "protected_attributes": ["userName", "active", "emails", "displayName", "value", "primary", "apiKeys"], "blacklist_attributes": ["schemas", "id", "meta", "$ref"], "separator_ui_attributes": "->", "color_web_background": "#D7EDEC", "color_web_header": "#FFFFFF", "logo_alt_name": "EOEPCA Logo", "logo_image_path": "/static/img/logo.png", "color_header_table": "#38A79F", "color_text_header_table": "white", "color_button_modify": "#38A79F", "use_threads": true, "debug_mode": true}
2 changes: 1 addition & 1 deletion src/custom_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, config,use_env_var):
redirectURIs=["https://"+config["sso_url"]+"/web_ui/oauth/callback"]
logoutURI="http://"+config["sso_url"]+"/web_ui"
responseTypes=["code", "token", "id_token"]
scopes=["openid", "user_name", "permission", "email"]
scopes=["openid", "user_name", "permission", "email", "eoepca"]
sectorIdentifier="https://"+config["sso_url"]+"/oxauth/sectoridentifier/9b473868-fa96-4fd1-a662-76e3663c9726"
token_endpoint_auth_method=ENDPOINT_AUTH_CLIENT_POST
scim_client2.registerClient("UserClient", grantTypes, redirectURIs, logoutURI, responseTypes, scopes, token_endpoint_auth_method, sectorIdentifier=sectorIdentifier)
Expand Down
Loading

0 comments on commit 9fe91c8

Please sign in to comment.