Skip to content

Commit

Permalink
- version updates
Browse files Browse the repository at this point in the history
- brave & zipkin
  • Loading branch information
MichiBaum committed Feb 17, 2024
1 parent 68febf6 commit e7cc1aa
Show file tree
Hide file tree
Showing 28 changed files with 1,024 additions and 49 deletions.
11 changes: 9 additions & 2 deletions admin-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.michibaum</groupId>
<artifactId>microservice</artifactId>
<version>1.0.0-TEST-7</version>
<version>1.0.0-TEST-8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -35,7 +35,14 @@
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
Expand Down
4 changes: 2 additions & 2 deletions authentication-library/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>microservice</artifactId>
<groupId>com.michibaum</groupId>
<version>1.0.0-TEST-7</version>
<version>1.0.0-TEST-8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
17 changes: 12 additions & 5 deletions authentication-service/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>microservice</artifactId>
<groupId>com.michibaum</groupId>
<version>1.0.0-TEST-7</version>
<version>1.0.0-TEST-8</version>
</parent>

<artifactId>authentication-service</artifactId>
Expand Down Expand Up @@ -52,7 +52,14 @@
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
</dependency>

<dependency>
Expand All @@ -79,12 +86,12 @@
<dependency>
<groupId>com.michibaum</groupId>
<artifactId>authentication-library</artifactId>
<version>1.0.0-TEST-7</version>
<version>1.0.0-TEST-8</version>
</dependency>
<dependency>
<groupId>com.michibaum</groupId>
<artifactId>usermanagement-library</artifactId>
<version>1.0.0-TEST-7</version>
<version>1.0.0-TEST-8</version>
</dependency>

</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion authentication-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spring:
datasource:
username: root
password: ${DATABASE_PASSWORD}
driver-class-name: com.mysql.jdbc.Driver
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://authentication-db:3306/${AUTHENTICATION_DB}
jpa:
hibernate:
Expand Down
31 changes: 21 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.7'
services:

registry-service:
image: 70131370/registry-service:1.0.0-TEST-7
image: 70131370/registry-service:1.0.0-TEST-8
env_file:
- .env
- .env.override
Expand All @@ -16,7 +16,7 @@ services:
- microservice-network

admin-service:
image: 70131370/admin-service:1.0.0-TEST-7
image: 70131370/admin-service:1.0.0-TEST-8
env_file:
- .env
- .env.override
Expand All @@ -31,7 +31,7 @@ services:
- microservice-network

javadoc-service:
image: 70131370/javadoc-service:1.0.0-TEST-7
image: 70131370/javadoc-service:1.0.0-TEST-8
env_file:
- .env
- .env.override
Expand All @@ -46,7 +46,7 @@ services:
- microservice-network

authentication-service:
image: 70131370/authentication-service:1.0.0-TEST-7
image: 70131370/authentication-service:1.0.0-TEST-8
env_file:
- .env
- .env.override
Expand Down Expand Up @@ -77,7 +77,7 @@ services:
- microservice-network

usermanagement-service:
image: 70131370/usermanagement-service:1.0.0-TEST-7
image: 70131370/usermanagement-service:1.0.0-TEST-8
env_file:
- .env
- .env.override
Expand Down Expand Up @@ -111,24 +111,35 @@ services:
- microservice-network

gateway-service:
image: 70131370/gateway-service:1.0.0-TEST-7
image: 70131370/gateway-service:1.0.0-TEST-8
env_file:
- .env
- .env.override
restart: always
depends_on:
- registry-service
- usermanagement-service
- authentication-service
- javadoc-service
- admin-service
environment:
spring_profiles_active: ${SPRING_ACTIVE_PROFILES}
ports:
- "80:80"
networks:
- microservice-network

zipkin-service:
image: 70131370/zipkin-service:1.0.0-TEST-8
env_file:
- .env
- .env.override
restart: always
depends_on:
- registry-service
environment:
spring_profiles_active: ${SPRING_ACTIVE_PROFILES}
expose:
- "80"
networks:
- microservice-network

# Matomo
# https://medium.com/@davquar/matomo-lets-install-it-with-docker-512211705c76
# https://github.com/matomo-org/docker
Expand Down
62 changes: 61 additions & 1 deletion docs/Diagram.drawio
Original file line number Diff line number Diff line change
@@ -1 +1,61 @@
<mxfile host="app.diagrams.net" modified="2022-10-13T21:44:13.734Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 OPR/91.0.4516.72" etag="ZZsbEuksRW6wo9XU9GZ8" version="20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Np5uy3268+aErf5dOkkbTz6qMk+wHIy23HYGqWXJgV1VvaZHvXD+yOL4NnMRT7msDCGknMAL1y7/o3OZl8y3SUIO49EiEC7fbj+xjtWz/VoFx9z8=</diagram></mxfile>
<mxfile host="Electron" modified="2023-12-23T11:17:07.763Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.1.2 Chrome/114.0.5735.289 Electron/25.9.4 Safari/537.36" etag="ue9drpFPXwW-tm6oexfc" version="22.1.2" type="device">
<diagram id="OQ9CddM-hfgQPHA02e66" name="Page-1">
<mxGraphModel dx="2302" dy="1316" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="i-3n_3hnF3vpz_gC9HeC-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="480" y="120" width="1050" height="800" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-2" value="registry-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="600" y="200" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-3" value="gateway-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="600" y="320" width="120" height="350" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-4" value="authentication-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="720" y="750" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-5" value="usermanagement-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="880" y="340" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-6" value="javadoc-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="880" y="460" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-7" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="880" y="590" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-10" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="480" y="1000" width="1050" height="800" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-11" value="registry-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="600" y="1080" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="i-3n_3hnF3vpz_gC9HeC-12" target="i-3n_3hnF3vpz_gC9HeC-13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-12" value="gateway-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="600" y="1200" width="120" height="350" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-13" value="authentication-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="720" y="1630" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-14" value="usermanagement-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="880" y="1220" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-15" value="javadoc-service" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="880" y="1340" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-16" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="880" y="1470" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="i-3n_3hnF3vpz_gC9HeC-17" target="i-3n_3hnF3vpz_gC9HeC-12">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="i-3n_3hnF3vpz_gC9HeC-17" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="384" y="1345" width="30" height="60" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
4 changes: 2 additions & 2 deletions gateway-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>microservice</artifactId>
<groupId>com.michibaum</groupId>
<version>1.0.0-TEST-7</version>
<version>1.0.0-TEST-8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>com.michibaum</groupId>
<artifactId>permission-library</artifactId>
<version>1.0.0-TEST-7</version>
<version>1.0.0-TEST-8</version>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
package com.michibaum.gatewayservice

import com.michibaum.permission_library.PermissionUtil
import com.michibaum.permission_library.Permissions
import org.springframework.cloud.gateway.filter.GatewayFilter
import org.springframework.cloud.gateway.filter.GatewayFilterChain
import org.springframework.web.server.ServerWebExchange
import reactor.core.publisher.Mono


class AuthorizationPreFilter() : GatewayFilter {

private var permissions: List<PermissionUtil> = listOf()

private lateinit var permissions: List<PermissionUtil>

constructor(vararg permissions: PermissionUtil) : this() {
this.permissions = permissions.asList()
}

override fun filter(exchange: ServerWebExchange?, chain: GatewayFilterChain?): Mono<Void> {
// ServerWebExchangeUtils.
exchange?.let {
// permissions.get(0).toPermissionString()
permissions.get(0).toPermissionString()
}
chain?.let {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.michibaum.gatewayservice

import com.michibaum.permission_library.Permissions
import org.springframework.cloud.gateway.route.RouteLocator
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder
import org.springframework.cloud.gateway.route.builder.filters
import org.springframework.cloud.gateway.route.builder.routes
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
Expand All @@ -14,7 +16,7 @@ class RoutesConfiguration {
return builder.routes {
route {
host("admin.michibaum.ch")
// filters { AuthorizationPreFilter() } // Permissions.Admin_Service.CAN_SEND_REQUEST
// filters { AuthorizationPreFilter(Permissions.Admin_Service.CAN_SEND_REQUEST) }
uri("lb://admin-service")
}
route {
Expand All @@ -24,7 +26,7 @@ class RoutesConfiguration {
}
route {
host("javadoc.michibaum.ch")
// filters { AuthorizationPreFilter() } // Permissions.JavaDoc_Service.CAN_READ
// filters { AuthorizationPreFilter(Permissions.JavaDoc_Service.CAN_READ) }
uri("lb://javadoc-service")
}
route {
Expand All @@ -37,6 +39,11 @@ class RoutesConfiguration {
// filters { AuthorizationPreFilter() }
uri("lb://usermanagement-service")
}
route {
host("zipkin.michibaum.ch")
// filters { AuthorizationPreFilter() }
uri("lb://zipkin-service")
}
route {
host("google.michibaum.ch")
// filters { AuthorizationPreFilter() }
Expand Down
13 changes: 10 additions & 3 deletions javadoc-service/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>microservice</artifactId>
<groupId>com.michibaum</groupId>
<version>1.0.0-TEST-7</version>
<version>1.0.0-TEST-8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -31,7 +31,14 @@
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
Expand Down
4 changes: 2 additions & 2 deletions permission-library/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>microservice</artifactId>
<groupId>com.michibaum</groupId>
<version>1.0.0-TEST-7</version>
<version>1.0.0-TEST-8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit e7cc1aa

Please sign in to comment.