diff --git a/.cfignore b/.cfignore new file mode 100644 index 0000000000000000000000000000000000000000..124eb4d817a9fd4c0ab1a6821b94a1b62ef46d56 --- /dev/null +++ b/.cfignore @@ -0,0 +1,2 @@ +launchConfigurations/ +.git/ \ No newline at end of file diff --git a/launchConfigurations/dummy-service.launch b/launchConfigurations/dummy-service.launch new file mode 100644 index 0000000000000000000000000000000000000000..615918c58b412e00e7cf0bb684d469cc808cc0b3 --- /dev/null +++ b/launchConfigurations/dummy-service.launch @@ -0,0 +1,17 @@ +{ + "ServiceId": "com.ibm.cloudoe.orion.client.deploy", + "Params": { + "Target": { + "Url": "https://api.eu-gb.cf.cloud.ibm.com", + "Org": "organisation one", + "Space": "dev" + }, + "Name": "dummy-service", + "Instrumentation": { + "domain": "eu-gb.mybluemix.net", + "instances": "1" + } + }, + "Path": "manifest.yml", + "Type": "Cloud Foundry" +} \ No newline at end of file diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 0000000000000000000000000000000000000000..af2459c4095cfd7a2b2c571a72171cd4d833d458 --- /dev/null +++ b/manifest.yml @@ -0,0 +1,6 @@ +--- +applications: +- buildpack: https://github.com/cloudfoundry/staticfile-buildpack.git + host: dummy-service + name: dummy-service + memory: 64M \ No newline at end of file diff --git a/src/main/java/de/rtuni/ms/ds/Application.java b/src/main/java/de/rtuni/ms/ds/Application.java new file mode 100644 index 0000000000000000000000000000000000000000..e41108bb0016926cb0c54ddaefe015eea29fe47b --- /dev/null +++ b/src/main/java/de/rtuni/ms/ds/Application.java @@ -0,0 +1,31 @@ +/* + * Copyright 2019 (C) by Julian Horner. + * All Rights Reserved. + */ + +package de.rtuni.ms.ds; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.eureka.EnableEurekaClient; + +/** + * Dummy service. + * + * @author Julian + * + */ +@SpringBootApplication +@EnableEurekaClient +public class Application { + //--------------------------------------------------------------------------------------------- + + /** + * Starts the application. + * + * @param args The arguments + */ + public static void main(final String[] args) { SpringApplication.run(Application.class, args); } + + //--------------------------------------------------------------------------------------------- +} diff --git a/src/main/java/de/rtuni/ms/ds/HomeController.java b/src/main/java/de/rtuni/ms/ds/HomeController.java new file mode 100644 index 0000000000000000000000000000000000000000..6673d9665e3703eef2c5d53794177dceb2d51c64 --- /dev/null +++ b/src/main/java/de/rtuni/ms/ds/HomeController.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019 (C) by Julian Horner. + * All Rights Reserved. + */ + +package de.rtuni.ms.ds; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * Class that handles all kind of requests. + * + * @author Julian + * + */ +@Controller +public class HomeController { + //--------------------------------------------------------------------------------------------- + + /** + * Catches the request for the start page and returns the name of the corresponding template. + * + * @return The name of the template + */ + @RequestMapping("/") + public String index() { + return "index"; + } + + /** + * Catches the request for the secure page and returns the name of the corresponding template. + * + * @return The name of the template + */ + @RequestMapping("/securePage") + public String securePage() { + return "securePage"; + } + + //--------------------------------------------------------------------------------------------- +} \ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html new file mode 100644 index 0000000000000000000000000000000000000000..ab3188e772de7271da730a4032fd98c5c508e862 --- /dev/null +++ b/src/main/resources/templates/index.html @@ -0,0 +1,11 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org"> + <head> + <title>Dummy page</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + </head> + <body> + <h1>Page without authentication</h1> + <a href="#" th:href="@{/securePage}">geschützte Seite anfordern</a> + </body> +</html> diff --git a/src/main/resources/templates/securePage.html b/src/main/resources/templates/securePage.html new file mode 100644 index 0000000000000000000000000000000000000000..55b35749559211f31c4247b744faedd6d2f0a7bf --- /dev/null +++ b/src/main/resources/templates/securePage.html @@ -0,0 +1,11 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org"> + <head> + <title>Very secure page</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + </head> + <body> + <h1>Page with authentication</h1> + <a href="#" th:href="@{/}">You're authorised to see this page</a> + </body> +</html> \ No newline at end of file