Skip to content

Commit

Permalink
Add connect devtokens to devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepdeJong committed Oct 11, 2023
1 parent f137cb6 commit 6b333e3
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 141 deletions.
76 changes: 4 additions & 72 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
version: '3.8'
version: "3.8"

volumes:
postgres-data:

services:
app:
container_name: javadev
build:
build:
context: .
dockerfile: Dockerfile
environment:
SPRING_PROFILES_ACTIVE: devcontainer

volumes:
- ../..:/workspaces:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

Expand All @@ -24,7 +24,6 @@ services:
depends_on:
- postgres
- mailcatcher
- connect

postgres:
image: postgres:latest
Expand All @@ -35,75 +34,8 @@ services:
POSTGRES_USER: postgres
POSTGRES_DB: events
POSTGRES_HOST_AUTH_METHOD: trust

mailcatcher:
image: schickling/mailcatcher
restart: on-failure
network_mode: service:postgres

connect:
image: soluto/oidc-server-mock
restart: on-failure
network_mode: service:postgres
environment:
ASPNETCORE_ENVIRONMENT: Development
API_SCOPES_INLINE: |
- Name: events
- Name: some-app-scope-2
API_RESOURCES_INLINE: |
- Name: events
Scopes:
- events
USERS_CONFIGURATION_INLINE: |
[
{
"id": "NORMAL_USER",
"sub": "WISVCH.404",
"email": "[email protected]",
"name": "User Test",
"google_username": "usert",
"google_groups": ["beheer"]
}
]
USERS_CONFIGURATION_INLINE: |
[
{
"SubjectId":"1",
"Username":"user",
"Password":"user",
"Claims": [
{
"Type": "name",
"Value": "user test",
"ValueType": "string"
},
{
"Type": "email",
"Value": "[email protected]",
"ValueType": "string"
},
{
"Type": "sub",
"Value": "WISVCH.404",
"ValueType": "string"
},
{
"Type": "google_username",
"Value": "usert",
"ValueType": "string"
},
{
"Type": "google_groups",
"Value": "[]",
"ValueType": "json"
}
]
}
]
CLIENTS_CONFIGURATION_PATH: /openid-config.json
configs:
- openid-config.json

configs:
openid-config.json:
file: ./oidc-settings/openid.json
141 changes: 72 additions & 69 deletions config/application-devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,87 +4,90 @@
##################################################################################################

spring:
datasource:
# DATABASE PROPERTIES
driverClassName: org.postgresql.Driver
# Change <MyDb> with the name of your database name
url: jdbc:postgresql://localhost:5432/events

# Username to log in to the database
# It's recommended to create a dedicated Database user instead of using the default postgres user
username: postgres

# Password to log in with <MyDbPassword> in database <MyDb>
password:

data.jpa.repositories.enabled: true

flyway:
enabled: false

jpa:
# Set to false in production to prevent spamming of console
show-sql: true
hibernate.type: trace
type: trace
database-platform: org.hibernate.dialect.PostgreSQLDialect
generate-ddl: true
hibernate.hb2mddl.auto: create-drop

# This setting defines the database creation/update behaviour. Change with caution.
properties.hibernate.default_schema: public

thymeleaf:
# THYMELEAF (ThymeleafAutoConfiguration)
check-template-location: true
suffix: .html
mode: HTML
encoding: UTF-8
content-type: text/html

mail:
host: 127.0.0.1
port: 1025

security:
oauth2:
client:
provider:
wisvchconnect:
issuer-uri: https://localhost:4011
clientUri: http://localhost:8080/events
registration:
wisvchconnect:d
client-id: client-credentials-mock-client
client-secret: client-credentials-mock-client-secret
scope:
- auth
- profile
- email
- openid

datasource:
# DATABASE PROPERTIES
driverClassName: org.postgresql.Driver
# Change <MyDb> with the name of your database name
url: jdbc:postgresql://localhost:5432/events

# Username to log in to the database
# It's recommended to create a dedicated Database user instead of using the default postgres user
username: postgres

# Password to log in with <MyDbPassword> in database <MyDb>
password:

data.jpa.repositories.enabled: true

flyway:
enabled: false

jpa:
# Set to false in production to prevent spamming of console
show-sql: true
hibernate.type: trace
type: trace
database-platform: org.hibernate.dialect.PostgreSQLDialect
generate-ddl: true
hibernate.hb2mddl.auto: create-drop

# This setting defines the database creation/update behaviour. Change with caution.
properties.hibernate.default_schema: public

thymeleaf:
# THYMELEAF (ThymeleafAutoConfiguration)
check-template-location: true
suffix: .html
mode: HTML
encoding: UTF-8
content-type: text/html

mail:
host: 127.0.0.1
port: 1025

security:
oauth2:
client:
provider:
wisvchconnect:
issuer-uri: https://connect.ch.tudelft.nl
clientUri: http://localhost:8080/events
registration:
wisvchconnect:
client-id: events-devcontainer
client-secret: AN6tZXQea8gFFfDgs_hoUDeiBXPh6CZuvZFE9kBgxzQ2MoHgVzWkPrtSMrNpn75Ems9v4iaz6gRFf0ECY4Q8YEE
scope:
- auth
- profile
- email
- auth

# Spring mail
# Database migration automation. Set to false for development

# Serve connect
server:
port: 8081
servlet.context-path: /events
port: 8081
servlet.context-path: /

# CH Connect Configuration
wisvch.connect:
# Change <MyLDAPgroup> to a LDAP group you're in (e.g. hoothub, dienst2, etc.)
admin-groups:
- hoothub
- beheer
claimName: google_groups
# Change <MyLDAPgroup> to a LDAP group you're in (e.g. hoothub, dienst2, etc.)
admin-groups:
- hoothub
- beheer
claimName: google_groups

# CH Events Configuration
wisvch.events:
image.path: http://localhost:8080/events/api/v1/documents/
image.path: http://localhost:8080/events/api/v1/documents/

# CH mollie api key
mollie:
apikey: test
clientUri: http://localhost:8080/events
apikey: test
clientUri: http://localhost:8080/events

links:
gtc: https://ch.tudelft.nl
passes: https://ch.tudelft.nl/passes

0 comments on commit 6b333e3

Please sign in to comment.