org.rapidpm.vaadin:flow-security-test

Dependencies for the RapidPM projects

License

License

Categories

Categories

Vaadin User Interface Web Frameworks Security
GroupId

GroupId

org.rapidpm.vaadin
ArtifactId

ArtifactId

flow-security-test
Last Version

Last Version

00.08.00-RPM
Release Date

Release Date

Type

Type

jar
Description

Description

Dependencies for the RapidPM projects
Project Organization

Project Organization

Vaadin

Download flow-security-test

How to add to project

<!-- https://jarcasting.com/artifacts/org.rapidpm.vaadin/flow-security-test/ -->
<dependency>
    <groupId>org.rapidpm.vaadin</groupId>
    <artifactId>flow-security-test</artifactId>
    <version>00.08.00-RPM</version>
</dependency>
// https://jarcasting.com/artifacts/org.rapidpm.vaadin/flow-security-test/
implementation 'org.rapidpm.vaadin:flow-security-test:00.08.00-RPM'
// https://jarcasting.com/artifacts/org.rapidpm.vaadin/flow-security-test/
implementation ("org.rapidpm.vaadin:flow-security-test:00.08.00-RPM")
'org.rapidpm.vaadin:flow-security-test:jar:00.08.00-RPM'
<dependency org="org.rapidpm.vaadin" name="flow-security-test" rev="00.08.00-RPM">
  <artifact name="flow-security-test" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.rapidpm.vaadin', module='flow-security-test', version='00.08.00-RPM')
)
libraryDependencies += "org.rapidpm.vaadin" % "flow-security-test" % "00.08.00-RPM"
[org.rapidpm.vaadin/flow-security-test "00.08.00-RPM"]

Dependencies

compile (14)

Group / Artifact Type Version
org.rapidpm.vaadin : flow-security jar 00.08.00-RPM
org.stagemonitor : stagemonitor-web-servlet jar 0.88.9
net.bytebuddy : byte-buddy jar 1.8.11
javax.servlet : javax.servlet-api jar 4.0.1
org.eclipse.jetty : jetty-continuation jar 9.4.19.v20190610
org.eclipse.jetty : jetty-server jar 9.4.19.v20190610
org.eclipse.jetty.websocket : websocket-server jar 9.4.19.v20190610
org.eclipse.jetty.websocket : javax-websocket-server-impl jar 9.4.19.v20190610
org.rapidpm.vaadin : id-generator-for-flow jar 00.09.00-RPM
org.slf4j : slf4j-api jar 1.7.25
org.slf4j : slf4j-simple jar 1.7.25
com.vaadin : vaadin jar
org.rapidpm : rapidpm-functional-reactive jar 01.00.03-RPM
org.rapidpm : rapidpm-logger-adapter jar 01.00.03-RPM

test (7)

Group / Artifact Type Version
org.testcontainers : testcontainers jar 1.11.4
org.testcontainers : selenium jar 1.11.4
org.seleniumhq.selenium : selenium-chrome-driver jar 3.141.59
org.junit.jupiter : junit-jupiter-api jar 5.5.1
org.junit.jupiter : junit-jupiter-params jar 5.5.1
org.junit.platform : junit-platform-launcher jar 1.5.1
org.junit.jupiter : junit-jupiter-engine jar 5.5.1

Project Modules

There are no modules declared in this project.
Vaadin Logo

#Vaadin Flow Security How to build different Security Aspects into a Flow Application.

Module flow-security

This module contains all generic parts that could be shared between projects.

Module flow-security-test

This module is a demo app using the module flow-security

Different possibilities

Basic LoginView

This LoginView will have basic elements you need for an authorization. What ever is part of the base LoginView, it will never be the right thing. How to extend this, have a look into the custom implementation in the the demo app. The class name is MyLoginView.

Roles and Permissions

Every System will have its own way to describe Roles and Permission. The only thing I assume here is, that for example a Role will have a name.

public final class RoleName
    extends Single<String> {
  public RoleName(String s) {
    super(s);
  }
  public String roleName() {
    return getT1();
  }
}

The interface HasRoles will be used inside the generic implementation to get access to this information. The custom part will be responsible to map from the existing system to this Interfaces. The demo app will show this inside the class MyAuthorizationService.

  • Login
  • Free View and Restricted Views
  • MenuBar based on User-Roles/Rights
  • Components are visible based on User-Roles/Rights

How to use it in your project

In this section I will describe the steps that are needed to use this in your project. If you want to have a starter app that is always containing this and some other features like I18N, have a look at the following: XXXXX

For every step I will give you the name of the corresponding implementation inside the demo app.

  • Define the class that will hold your user informations inside a session: MyUSer
  • Access to your DataSource including the mapping: UserStorage
  • Define your Role enum: AuthorizationRole
  • Define the Annotation you want to use in your app to declare the role: VisibleFor
  • extend the class RoleAccessEvaluator: MyRoleAccessEvaluator
  • implement the AuthorizationService: MyAuthenticationService

Supported JDK

This example is running from JDK8 up to JDK13

target of this project

The target of this project is a minimal rampup time for a first hello world. Why we need one more HelloWorld? Well, the answer is quite easy. If you have to try something out, or you want to make a small POC to present something, there is no time and budget to create a demo project. You don´t want to copy paste all small things together. Here you will get a Nano-Project that will give you all in a second.

Clone the repo and start editing the file NanoVaadinOnKotlin.kt. Nothing more.

How does it work?

Internally it will ramp up a Jetty. If you want to see how this is done, have a look inside the class CoreUIService.

How a developer can use this

You as a developer can use it like it is shown in the demo folder inside the src path.

fun main() {
  CoreUIService().startup()
}
@Route("")
class VaadinApp : Composite<Div>(), HasLogger {

  private val btnClickMe = Button("click me")
  private val lbClickCount = Span("0")
  private val layout = VerticalLayout(btnClickMe, lbClickCount)

  private var clickcount = 0

  init {
    btnClickMe.setId(BTN_CLICK_ME)
    btnClickMe.addClickListener { event -> lbClickCount.text = (++clickcount).toString() }

    lbClickCount.setId(LB_CLICK_COUNT)

    logger().info("and now..  setting the main content.. ")
    content.add(layout)
  }

  companion object {

    val BTN_CLICK_ME = "btn-click-me"
    val LB_CLICK_COUNT = "lb-click-count"
  }
}

Happy Coding.

if you have any questions: ping me on Twitter https://twitter.com/SvenRuppert or via mail.

org.rapidpm.vaadin

Vaadin Developer

Jumpstarts and HowTos for Vaadin based projects

Versions

Version
00.08.00-RPM