Skip to content

Commit

Permalink
Adapting documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cuioss committed Aug 23, 2024
1 parent b329cb3 commit f76bd4a
Show file tree
Hide file tree
Showing 18 changed files with 191 additions and 194 deletions.
4 changes: 1 addition & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ https://cuioss.github.io/cui-portal-core/about.html[Generated Documentation on g

== What is it?

The core modules of the cui-portal incorporate portal-configuration and portal-authentication mechanisms and some more
The core modules of the cui-portal incorporate portal-configuration and portal-authentication mechanisms and some more ...

=== Maven Coordinates

Expand All @@ -35,8 +35,6 @@ The core modules of the cui-portal incorporate portal-configuration and portal-a

link:modules/authentication/[portal-authentication]

link:modules/configuration/[portal-configuration]

link:modules/core/[portal-core]

link:modules/micro-profile/[micro-profile]
Expand Down
7 changes: 3 additions & 4 deletions modules/authentication/portal-authentication-mock/README.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
= portal-authentication-mock
:toc:


== What is it?
Implementation of 'portal-authentication-api' for cases where it is only needed technically or for documentation purpose.
In contrast to 'portal-authentication-dummy' this module must never be used in production environments.
Implementation of 'link:../portal-authentication-api/[portal-authentication-api]' for cases,
where it is only needed technically or for documentation purpose.
In contrast to 'link:../portal-authentication-dummy/[portal-authentication-dummy]' this module must never be used in production environments.

== Maven Coordinates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,28 @@
*/
package de.cuioss.portal.authentication.mock;

import static java.util.Objects.requireNonNull;

import java.util.ArrayList;
import java.util.List;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.inject.Provider;
import jakarta.servlet.http.HttpServletRequest;

import org.eclipse.microprofile.config.inject.ConfigProperty;

import de.cuioss.portal.authentication.AuthenticatedUserInfo;
import de.cuioss.portal.authentication.facade.AuthenticationFacade;
import de.cuioss.portal.authentication.facade.AuthenticationResults;
import de.cuioss.portal.authentication.facade.AuthenticationSource;
import de.cuioss.portal.authentication.facade.FormBasedAuthenticationFacade;
import de.cuioss.portal.authentication.facade.PortalAuthenticationFacade;
import de.cuioss.portal.authentication.facade.*;
import de.cuioss.portal.authentication.model.BaseAuthenticatedUserInfo;
import de.cuioss.portal.authentication.model.BaseAuthenticatedUserInfo.BaseAuthenticatedUserInfoBuilder;
import de.cuioss.portal.authentication.model.UserStore;
import de.cuioss.portal.configuration.types.ConfigAsList;
import de.cuioss.uimodel.application.LoginCredentials;
import de.cuioss.uimodel.result.ResultObject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.inject.Provider;
import jakarta.servlet.http.HttpServletRequest;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.eclipse.microprofile.config.inject.ConfigProperty;

import java.util.ArrayList;
import java.util.List;

import static java.util.Objects.requireNonNull;

/**
* Dummy implementation of the {@link AuthenticationFacade} interface.
Expand Down Expand Up @@ -149,7 +143,7 @@ public class MockAuthenticationFacade implements FormBasedAuthenticationFacade {
*/
@Override
public ResultObject<AuthenticatedUserInfo> login(final HttpServletRequest servletRequest,
final LoginCredentials loginCredentials) {
final LoginCredentials loginCredentials) {
requireNonNull(loginCredentials);
requireNonNull(servletRequest);
if (loginCredentials.isComplete()
Expand Down Expand Up @@ -196,7 +190,7 @@ public boolean logout(final HttpServletRequest servletRequest) {
public AuthenticatedUserInfo retrieveCurrentAuthenticationContext(final HttpServletRequest servletRequest) {
var userInfo = (AuthenticatedUserInfo) servletRequest.getSession().getAttribute(USER_INFO_KEY);
if (null == userInfo) {
if (defaultLoggedIn.get().booleanValue()) {
if (defaultLoggedIn.get()) {
var userName = defaultUserName.get();
userInfo = createDefaultUserInfoBuilder().identifier(userName).qualifiedIdentifier(userName)
.displayName(userName).build();
Expand Down
28 changes: 28 additions & 0 deletions modules/authentication/portal-authentication-oauth/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
= portal-authentication-mock

== What is it?

Implementation of 'link:../portal-authentication-api/[portal-authentication-api]'.
It is the current default implementation for production variants the cuioss-portal.

It must always be used in conjunction with a concrete ui-module, currently this is https://github.com/cuioss/cui-portal-ui/tree/main/modules/portal-ui-oauth[portal-ui-oauth]

== Maven Coordinates

[source,xml]
----
<dependency>
<groupId>de.cuioss.portal.authentication</groupId>
<artifactId>portal-authentication-oauth</artifactId>
</dependency>
----

== Configuration

See link:src/main/resources/META-INF/microprofile-config.properties[microprofile-config.properties]

== Usage

In addition to the injection of the `AuthenticatedUserInfo` it provides the link:src/main/java/de/cuioss/portal/authentication/oauth/Oauth2AuthenticationFacade.java[Oauth2AuthenticationFacade]
that gives you access on advanced OIDC feature like handling of the RefreshToken, scope-step-up and https://openid.net/specs/openid-connect-rpinitiated-1_0.html[OpenID Connect RP-Initiated Logout].
See the javadoc for details.
43 changes: 0 additions & 43 deletions modules/authentication/portal-authentication-oauth/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ config_name=portal-authentication-oauth
# The URL to the oauth2 servers token REST endpoint.
# This config parameter should only be used to set cluster-internal URLs for server-to-server communication.
# The external URL is, per default, retrieved from the well-known endpoint (authentication.oidc.server.discovery_path).
# Example URL: https://xyz/member-account-facade/oidc.
# Example URL: https://oauth-facade/oidc.
# authentication.oidc.server.token_endpoint_url=

# The URL to the oauth2 servers userinfo REST endpoint.
# This config parameter should only be used to set cluster-internal URLs for server-to-server communication.
# The external URL is, per default, retrieved from the well-known endpoint (authentication.oidc.server.discovery_path).
# Example URL: https://xyz/member-account-facade/oidc.
# Example URL: https://oauth-facade/oidc.
# authentication.oidc.server.userinfo_endpoint_url=

# Defines the default scopes to be requested by the client.
Expand All @@ -30,8 +30,7 @@ authentication.oidc.client.default_scopes=openid profile

# Defines the name of the claim / attribute that is used
# for mapping the roles to the user; multiple values are allowed, separated by comma.
# Defaults to 'ehealth-suite-roles'
authentication.oidc.client.role_mapper_claim=ehealth-suite-roles
# authentication.oidc.client.role_mapper_claim=

# Defines the parameter name to transport the url to redirect after logout.
# Defaults to 'post_logout_redirect_uri'
Expand All @@ -49,18 +48,18 @@ authentication.oidc.client.logout_redirect_parameter=post_logout_redirect_uri
authentication.oidc.client.logout.params.add_id_token_hint=true

# The url of the server that provides the authentication endpoints.
# It is interpreted as a complete url including context path,
# It is interpreted as a complete url including a context path,
# Must be set by the installation.
#authentication.oidc.server.url=

# If true, validates the final config, i.e. ensuring that required attributes are present.
# If true, validates the final config, i.e., ensuring that required attributes are present.
authentication.oidc.validation.enabled=true

# The url relative to #url defining the OpenID Connect Discovery endpoint,
# defaults to '.well-known/openid-configuration'.
# In case of #type being "keycloak" this setting will be ignored.
# In the case of #type being "keycloak" this setting will be ignored.
authentication.oidc.server.discovery_path=.well-known/openid-configuration

# The external (i.e. not cluster internal) hostname of the authentication service provider.
# This hostname is used to e.g. calculate the redirect uri for the web-browser.
# The external (i.e., not cluster internal) hostname of the authentication service provider.
# This hostname is used to e.g., calculate the redirect uri for the web-browser.
#authentication.externalHostname=
8 changes: 8 additions & 0 deletions modules/core/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
= portal-core

== What is it?

Provides some basic-classes / utilities

* link:portal-common-cdi/[portal-common-cdi]
* link:portal-core/[portal-core]
23 changes: 23 additions & 0 deletions modules/core/portal-common-cdi/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
= portal-common-cdi

== What is it?
Provides some base-types and utilities.

== Maven Coordinates

[source, xml]
----
<dependency>
<groupId>de.cuioss.portal.core</groupId>
<artifactId>portal-common-cdi</artifactId>
</dependency>
----

== Core Types and Concepts

* link:src/main/java/de/cuioss/portal/common/bundle/package-info.java[Handling of Resource Bundles]
* link:src/main/java/de/cuioss/portal/common/cdi/PortalBeanManager.java[PortalBeanManager]
* link:src/main/java/de/cuioss/portal/common/locale/PortalLocale.java[PortalLocale]
* link:src/main/java/de/cuioss/portal/common/priority/package-info.java[Priority-Tooling]
* link:src/main/java/de/cuioss/portal/common/stage/ProjectStage.java[ProjectStage]
* link:src/main/java/de/cuioss/portal/common/util/PortalResourceLoader.java[PortalResourceLoader]
Loading

0 comments on commit f76bd4a

Please sign in to comment.