Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFS-1079, FFS-1111, FFS-1113 #16

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
d4cdef3
wip commit
Battlestad Jun 12, 2024
0c9f2d1
add caching of azure app roles and azure users based on permitted roles
Battlestad Jun 13, 2024
ac780c8
add deployment credentials for azure in fintlabs beta
Battlestad Jun 13, 2024
8780650
add deployment credentials for azure in fintlabs beta
Battlestad Jun 13, 2024
739369f
add deployment credentials for azure in fintlabs beta
Battlestad Jun 13, 2024
54b22d4
add sorting on email when getting userpermissions
Battlestad Jun 13, 2024
54b770f
add sorting on email when returning result after posting userpermissions
Battlestad Jun 13, 2024
86cd6c8
polling azure user data every hour
Battlestad Jun 13, 2024
20ab093
fix bug where app role and app role assignments were duplicated in cache
Battlestad Jun 14, 2024
56cd358
fix bug where app role and app role assignments were duplicated in cache
Battlestad Jun 14, 2024
038970c
refactor
Battlestad Jun 14, 2024
24e3545
refactor
Battlestad Jun 14, 2024
81fe73d
handle missing azure ad app credentials
Battlestad Jun 20, 2024
20b4c35
add vestfold and telemark to fetch 1password azure credentials
Battlestad Jun 20, 2024
4d65312
add ofk to fetch 1password azure credentials
Battlestad Jun 21, 2024
ebb9f99
add afk, bfk, telemark, vestfold, innlandet to fetch 1password azure …
Battlestad Jun 21, 2024
89386e9
add try catch to prevent empty lists on graph error when updating use…
Battlestad Jun 24, 2024
9b4b7c4
add name for user in cache
Battlestad Jun 24, 2024
d77946f
order by name instead of mail
Battlestad Jun 24, 2024
1f7b037
remove unneeded logging
Battlestad Jun 24, 2024
c611fbd
move success logging within try catch
Battlestad Jun 26, 2024
1da53eb
remove possibility to create new users on endpoint for setting user p…
Battlestad Jun 26, 2024
906b3c9
FFS-1102 make endpoints RESTful and refactor
Battlestad Jun 26, 2024
9a71eee
FFS-1113 add azure ad credentials for nfk in api
Battlestad Jun 26, 2024
0127592
wip commit
Battlestad Jun 26, 2024
9f7e472
refactor and use FintCache
Battlestad Jun 27, 2024
9b93b59
refactor using UserDisplayTextCacheRepository to access and modify us…
Battlestad Jun 27, 2024
2e0d640
refactor using UserDisplayTextCacheRepository to access and modify us…
Battlestad Jun 27, 2024
35b7907
wip commit
Battlestad Jun 27, 2024
ecf614a
Remove unecessary caching and add separate graph services
eivindmorch Jun 27, 2024
e9367a9
cleanup
eivindmorch Jun 28, 2024
eeda2b9
add dependency to enable property
eivindmorch Jun 28, 2024
6ebaa51
Add pageable and change put to action post
eivindmorch Jun 28, 2024
00731b3
wip commit
Battlestad Jun 28, 2024
a1a3ce8
change to store display info in db
eivindmorch Jun 28, 2024
5661833
rename sql table since 'user' is a reserved keyword
Battlestad Jul 1, 2024
424517a
add check for credentials to prevent schedueler from running if they …
Battlestad Jul 1, 2024
e267070
remove logging of appRoleAssignments
Battlestad Jul 1, 2024
16d12b1
diversify almost identical loglines
Battlestad Jul 1, 2024
cc5bf81
remove unused repository method
Battlestad Jul 1, 2024
e992392
add default builder to list in model
Battlestad Jul 1, 2024
3fd1d35
wrap content in array to prevent error on modifying unmutable list
Battlestad Jul 1, 2024
4b484a1
add transactional to method to be able to delete users
Battlestad Jul 1, 2024
c6cf1c2
update tests to use long sourceAppId's instead of String
Battlestad Jul 1, 2024
f69c2b7
update kustomize deployments with fint.flyt.azure-ad-gateway.enabled
Battlestad Jul 1, 2024
61f8f5d
change property azure-ad-gateway.enable to azure-ad-gateway.enabled
Battlestad Jul 1, 2024
7a0340e
replace pageable with custom pageable that is supported by webflux
Battlestad Jul 1, 2024
165844f
surround boolean value with '' to prevent Invalid value: "boolean": s…
Battlestad Jul 1, 2024
02d6b4b
always return access to all applications if users is admin
Battlestad Jul 2, 2024
86fb5dd
add rogfk to fetch 1password credentials for Azure AD
Battlestad Jul 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,24 @@ repositories {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'

implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.72.Final:osx-aarch_64'

implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'org.postgresql:postgresql'
implementation 'org.flywaydb:flyway-core'

implementation 'org.flywaydb:flyway-core'
implementation 'no.fintlabs:fint-kafka:4.0.1'
implementation 'no.fintlabs:fint-flyt-resource-server:2.1.0'

implementation 'javax.validation:validation-api'
implementation 'org.hibernate.validator:hibernate-validator'

implementation 'no.fintlabs:fint-flyt-resource-server:2.1.0-rc-3'
implementation 'com.azure:azure-identity:1.10.2'
implementation 'com.microsoft.graph:microsoft-graph:5.80.0'

compileOnly 'org.projectlombok:lombok'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
Expand Down
2 changes: 2 additions & 0 deletions kustomize/base/flais.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ spec:
}
- name: fint.flyt.resource-server.security.api.internal.enabled
value: 'true'
- name: fint.flyt.azure-ad-gateway.enabled
value: 'true'
onePassword:
itemPath: path
envFrom: []
Expand Down
3 changes: 2 additions & 1 deletion kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- flais.yaml
- flais.yaml
- onePassword.yaml
7 changes: 7 additions & 0 deletions kustomize/base/onePassword.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: fint-flyt-authorization-service
spec:
itemPath: "path set in overlay"

12 changes: 12 additions & 0 deletions kustomize/overlays/afk-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ patches:
value:
secretRef:
name: fint-flyt-acos-oauth2-client
- op: add
path: "/spec/envFrom/1"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-api-vault/items/fint-flyt-authorization-service-afk-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
3 changes: 3 additions & 0 deletions kustomize/overlays/agderfk-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: replace
path: "/spec/env/3/value"
value: 'false'
target:
kind: Application
name: fint-flyt-authorization-service
12 changes: 12 additions & 0 deletions kustomize/overlays/bfk-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ patches:
value:
secretRef:
name: fint-flyt-acos-oauth2-client
- op: add
path: "/spec/envFrom/1"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-api-vault/items/fint-flyt-authorization-service-bfk-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
3 changes: 3 additions & 0 deletions kustomize/overlays/ffk-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: replace
path: "/spec/env/3/value"
value: 'false'
target:
kind: Application
name: fint-flyt-authorization-service
12 changes: 12 additions & 0 deletions kustomize/overlays/fintlabs-no/beta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ patches:
value:
secretRef:
name: fint-flyt-vigo-oauth2-client
- op: add
path: "/spec/envFrom/2"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-beta-vault/items/fint-flyt-authorization-service-fintlabs-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
12 changes: 12 additions & 0 deletions kustomize/overlays/innlandetfylke-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: add
path: "/spec/envFrom/0"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-api-vault/items/fint-flyt-authorization-service-innlandetfylke-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
3 changes: 3 additions & 0 deletions kustomize/overlays/mrfylke-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: replace
path: "/spec/env/3/value"
value: 'false'
target:
kind: Application
name: fint-flyt-authorization-service
12 changes: 12 additions & 0 deletions kustomize/overlays/nfk-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: add
path: "/spec/envFrom/0"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-api-vault/items/fint-flyt-authorization-service-nfk-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
12 changes: 12 additions & 0 deletions kustomize/overlays/ofk-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ patches:
value:
secretRef:
name: fint-flyt-vigo-oauth2-client
- op: add
path: "/spec/envFrom/2"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-api-vault/items/fint-flyt-authorization-service-ofk-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
12 changes: 12 additions & 0 deletions kustomize/overlays/ofk-no/beta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ patches:
value:
secretRef:
name: fint-flyt-vigo-oauth2-client
- op: add
path: "/spec/envFrom/2"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-beta-vault/items/fint-flyt-authorization-service-ofk-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
12 changes: 12 additions & 0 deletions kustomize/overlays/rogfk-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: add
path: "/spec/envFrom/0"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-api-vault/items/fint-flyt-authorization-service-rogfk-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
12 changes: 12 additions & 0 deletions kustomize/overlays/telemarkfylke-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: add
path: "/spec/envFrom/0"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-api-vault/items/fint-flyt-authorization-service-telemarkfylke-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
3 changes: 3 additions & 0 deletions kustomize/overlays/tromsfylke-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: replace
path: "/spec/env/3/value"
value: 'false'
target:
kind: Application
name: fint-flyt-authorization-service
3 changes: 3 additions & 0 deletions kustomize/overlays/tromsfylke-no/beta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: replace
path: "/spec/env/3/value"
value: 'false'
- op: add
path: "/spec/envFrom/0"
value:
Expand Down
3 changes: 3 additions & 0 deletions kustomize/overlays/trondelagfylke-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: replace
path: "/spec/env/3/value"
value: 'false'
target:
kind: Application
name: fint-flyt-authorization-service
3 changes: 3 additions & 0 deletions kustomize/overlays/trondelagfylke-no/beta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: replace
path: "/spec/env/3/value"
value: 'false'
target:
kind: Application
name: fint-flyt-authorization-service
12 changes: 12 additions & 0 deletions kustomize/overlays/vestfoldfylke-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: add
path: "/spec/envFrom/0"
value:
secretRef:
name: fint-flyt-authorization-service
target:
kind: Application
name: fint-flyt-authorization-service
- patch: |-
- op: replace
path: "/spec/itemPath"
value: "vaults/aks-api-vault/items/fint-flyt-authorization-service-vestfoldfylke-no"
target:
kind: OnePasswordItem
name: fint-flyt-authorization-service
3 changes: 3 additions & 0 deletions kustomize/overlays/vlfk-no/api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: replace
path: "/spec/env/3/value"
value: 'false'
target:
kind: Application
name: fint-flyt-authorization-service
3 changes: 3 additions & 0 deletions kustomize/overlays/vlfk-no/beta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ patches:
"vigo.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"],
"novari.no":["https://role-catalog.vigoiks.no/vigo/flyt/developer"]
}
- op: replace
path: "/spec/env/3/value"
value: 'false'
- op: add
path: "/spec/env/-"
value:
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/no/fintlabs/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@ConfigurationPropertiesScan
@SpringBootApplication
public class Application {

Expand Down
11 changes: 0 additions & 11 deletions src/main/java/no/fintlabs/authorization/AuthorizationUtil.java

This file was deleted.

10 changes: 0 additions & 10 deletions src/main/java/no/fintlabs/authorization/adminuser/AdminUser.java

This file was deleted.

Loading
Loading