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

feat(services-bff): My pages bff setup #16543

Merged
merged 288 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
288 commits
Select commit Hold shift + click to select a range
f1f4d01
Fix user menu test
snaerseljan Sep 23, 2024
03dfb15
Updates to environment and config
snaerseljan Sep 23, 2024
30589f8
Update infra allowed external api urls to be hard coded
snaerseljan Sep 23, 2024
8594694
Simplify client urls with bff postfix in it
snaerseljan Sep 23, 2024
6c29c25
Add ingress to project and remove logout redirect path in favour of c…
snaerseljan Sep 23, 2024
752bc30
Add docker express to services bff
snaerseljan Sep 23, 2024
0af58c8
update config simpler syntax
snaerseljan Sep 23, 2024
7b86f8e
chore: nx format:write update dirty files
andes-it Sep 23, 2024
9bee7c7
Update config and redis dev setup
snaerseljan Sep 23, 2024
e653bb9
Update crypto service to include algorithm in the encryption, explain…
snaerseljan Sep 24, 2024
0bf3b42
Remove CORS entirely in favour of client proxy config
snaerseljan Sep 24, 2024
6fb7657
Update error handling in bff backend, refactor infra and handle error…
snaerseljan Sep 24, 2024
e7915c6
When proxy service errors then handle as unauthorized. Update targetU…
snaerseljan Sep 24, 2024
e709f2b
Remove unnecessary Uint8Array conversion
snaerseljan Sep 24, 2024
7f869b4
Simplify the BFFUser object to not have dateOfBirth and remove double…
snaerseljan Sep 25, 2024
9c45bd9
Update cookies to share constants, update options to be more secure
snaerseljan Sep 25, 2024
203df7a
access token expire time latency by 5 sec
snaerseljan Sep 25, 2024
615acb2
remove omit
snaerseljan Sep 25, 2024
46c279a
Update user profile cache ttl
snaerseljan Sep 25, 2024
c37b4ad
update cache ttl again and rename baseUrl to issuerUrl in ids service
snaerseljan Sep 25, 2024
536f8b9
reaname var
snaerseljan Sep 25, 2024
95bbb67
remove params from cache attempt that where not used in the callback
snaerseljan Sep 25, 2024
e65fb76
Clean up old session in login callback if it exists
snaerseljan Sep 25, 2024
609ce84
Fix login callback cache clean up and revoke refresh token
snaerseljan Sep 25, 2024
1e94f35
Update logout flow to clean up, revoke tokens and better validation. …
snaerseljan Sep 26, 2024
c878c37
remove unused import
snaerseljan Sep 26, 2024
f381696
Simplify error in favour of enhanced fetch
snaerseljan Sep 26, 2024
63e7197
created enhanced fetch module, moved pkce service to services, update…
snaerseljan Sep 26, 2024
4379b55
par support flag not optional
snaerseljan Sep 26, 2024
2bb7dee
Fix typo
snaerseljan Sep 26, 2024
0d1e967
Add better validation to crypto decryption function
snaerseljan Sep 26, 2024
08f0330
Update validate uri to be more secure, create test for validate uri. …
snaerseljan Sep 26, 2024
389d3c1
Remove state param from logout to ensure it will not be passed to red…
snaerseljan Sep 26, 2024
b411003
Adding more tests and increasing security in the function
snaerseljan Sep 26, 2024
efda624
Refactor after reading comments from coderabbit
snaerseljan Sep 26, 2024
7f0d132
remove private from method for test
snaerseljan Sep 26, 2024
3e6c02b
Move portal scopes to shareable location.
snaerseljan Sep 26, 2024
6af5e19
Remove unused import
snaerseljan Sep 26, 2024
fe5242c
Add no_refresh query to user endpoint in backend
snaerseljan Sep 26, 2024
fce5088
Polling and broadcaster added to react spa bff library
snaerseljan Sep 26, 2024
c03478b
Enhanced security in pkce service.and improve error handling to be mo…
snaerseljan Sep 27, 2024
7a61d8a
Update usePolling to have better types and secure resumabiltiy.
snaerseljan Sep 27, 2024
1c01c41
Refactor useBroadcaster.
snaerseljan Sep 27, 2024
361f60a
Add client logic to handle the case if bff server goes down
snaerseljan Sep 27, 2024
332c7e3
Fix tests and builds
snaerseljan Sep 30, 2024
03c1f3b
Merge branch 'main' into feat/bff
snaerseljan Sep 30, 2024
009ddcc
Fix portal infra local vars
snaerseljan Oct 3, 2024
c7f4a3c
DX infra setup for services-bff
snaerseljan Oct 3, 2024
006d2ab
Remove error log from revokeRefreshToken since it is handled by enhan…
snaerseljan Oct 7, 2024
600abfa
Rename cached toke fields to be prefixed with encrypted and fix where…
snaerseljan Oct 7, 2024
de47d6a
Better handling on errors in auth service
snaerseljan Oct 7, 2024
eae6fa4
Update api requests formatting and handling to handle exceptions and …
snaerseljan Oct 7, 2024
1558e41
Update apps/services/bff/src/app/bff.config.ts
snaerseljan Oct 7, 2024
3ea37b9
cleanup after commit from github
snaerseljan Oct 7, 2024
9093668
Update after our pull request AI suggested the change
snaerseljan Oct 7, 2024
8f38c92
Remove broadcaster mocks
snaerseljan Oct 8, 2024
4e871bf
Remove redundant timeout in favour of poller
snaerseljan Oct 8, 2024
f1ff85f
Fix portal config, fix redis cache module init, update bff provider t…
snaerseljan Oct 8, 2024
b941f52
Remove timeout in logout broadcasting and throw the error in postRequ…
snaerseljan Oct 8, 2024
3f6b99a
merge with main
snaerseljan Oct 8, 2024
684862f
Revert the timeout in the logout
snaerseljan Oct 8, 2024
bcc91ab
chore: charts update dirty files
andes-it Oct 8, 2024
d3a7552
Rename queries to dto for consistency in monorepo and add log for log…
snaerseljan Oct 8, 2024
16fce38
Fix cli error that got merged from main
snaerseljan Oct 8, 2024
bc9ed7b
Fix prettier formatting error
snaerseljan Oct 8, 2024
2048394
chore: nx format:write update dirty files
andes-it Oct 8, 2024
88a6e37
fix storybook build
snaerseljan Oct 8, 2024
422c0d3
Merge branch 'main' into feat/bff
snaerseljan Oct 9, 2024
fba6006
ci: trigger from levy user
busla Oct 9, 2024
aac4e2d
fix: use portals-admin, added portal-env test
busla Oct 9, 2024
f8b7ff2
Revert manual validation and use library
snaerseljan Oct 9, 2024
32e5ae2
Use fetch instead of post in download url
snaerseljan Oct 10, 2024
95293b4
Fix type errors and add forward get proxy api request
snaerseljan Oct 10, 2024
be9e744
fix: main conflict
busla Oct 10, 2024
4e93573
Merge branch 'main' into feat/bff
busla Oct 10, 2024
e884575
chore: charts update dirty files
andes-it Oct 10, 2024
4b2170c
fix: prettier issues
busla Oct 9, 2024
8d28af8
Merge branch 'feat/bff' of github.com:island-is/island.is into feat/bff
busla Oct 10, 2024
fbb3d62
chore: prettify
busla Oct 10, 2024
a59c6aa
chore: nx format:write update dirty files
andes-it Oct 10, 2024
0e89a62
Merge branch 'main' into feat/bff
busla Oct 10, 2024
202c4e6
ci: add services-bff to helm chart
busla Oct 10, 2024
a88b05b
Merge branch 'main' into feat/bff
snaerseljan Oct 11, 2024
49a565b
Fix env vars for feature deploy
snaerseljan Oct 11, 2024
083cc38
Fix health check to be excluded from prefix
snaerseljan Oct 14, 2024
4600b0a
fix merge conflicts with main
snaerseljan Oct 14, 2024
0cae4b9
update global prefix logic
snaerseljan Oct 14, 2024
5125897
update bff services options
snaerseljan Oct 14, 2024
39747f9
Remove bff redis name env var
snaerseljan Oct 14, 2024
cc66d65
Update bff config again
snaerseljan Oct 14, 2024
f3090b4
Merge branch 'main' into feat/bff
snaerseljan Oct 14, 2024
b12be6c
Update portal env spec for feature branch
snaerseljan Oct 14, 2024
1194115
chore: charts update dirty files
andes-it Oct 14, 2024
608deb9
Update validation error log
snaerseljan Oct 14, 2024
c542e49
Merge branch 'main' into feat/bff
snaerseljan Oct 14, 2024
6f3d84e
Remove database healthcheck
snaerseljan Oct 15, 2024
106b9bf
Revert globalprefix options and update liveness and readiness infra c…
snaerseljan Oct 15, 2024
bba3414
chore: charts update dirty files
andes-it Oct 15, 2024
0c1ec2d
Merge branch 'main' into feat/bff
snaerseljan Oct 15, 2024
8c406b9
Add auth controller tests
snaerseljan Oct 17, 2024
29235b5
Add logout log for testing in feature deploy
snaerseljan Oct 17, 2024
f46d382
remove unused
snaerseljan Oct 17, 2024
98ed4a5
clean up auth controller test
snaerseljan Oct 17, 2024
d10c6a5
fix merge conflicts with main
snaerseljan Oct 17, 2024
0730ac7
chore: nx format:write update dirty files
andes-it Oct 17, 2024
557edf3
Merge branch 'main' into feat/bff
snaerseljan Oct 18, 2024
5eff85f
Add tests for proxy controller
snaerseljan Oct 18, 2024
f041e0c
Add ref to infra for api
snaerseljan Oct 18, 2024
ac566f7
update charts
snaerseljan Oct 21, 2024
df27f32
add zed editor config to gitignore
snaerseljan Oct 21, 2024
58f57e4
Add support for mocks
snaerseljan Oct 21, 2024
380bd01
chore: nx format:write update dirty files
andes-it Oct 21, 2024
952be5d
Fix portal env spec
snaerseljan Oct 21, 2024
ffbbc1c
chore: charts update dirty files
andes-it Oct 21, 2024
75af346
Update mocking server logic for portals
snaerseljan Oct 21, 2024
5fe7c60
update mock logic
snaerseljan Oct 22, 2024
1395ef8
fix: public envs (#16493)
busla Oct 23, 2024
5a35ac7
Move my-pages over to bff first attempt
snaerseljan Oct 23, 2024
6fedbee
chore: remove nx-command impl (#16532)
busla Oct 23, 2024
6bbe418
Update infra setup
snaerseljan Oct 23, 2024
06be6dc
fix tests
snaerseljan Oct 23, 2024
c9d881b
chore: charts update dirty files
andes-it Oct 23, 2024
afd4ef7
Merge branch 'feat/bff' into feat/bff-my-pages
snaerseljan Oct 23, 2024
2649efd
update my pages infra
snaerseljan Oct 23, 2024
a4107b9
fix env in infra
snaerseljan Oct 23, 2024
31bf5d3
fix infra url
snaerseljan Oct 23, 2024
60b68c0
Removed un used import
snaerseljan Oct 23, 2024
35576b2
chore: charts update dirty files
andes-it Oct 23, 2024
f4e6b63
chore: nx format:write update dirty files
andes-it Oct 23, 2024
1c7ff06
fix: revert secret type changes
busla Oct 23, 2024
360f7c5
chore: nx format:write update dirty files
andes-it Oct 23, 2024
70f6a5c
chore: cleanup
busla Oct 23, 2024
db5d995
Merge branch 'feat/bff' of github.com:island-is/island.is into feat/bff
busla Oct 23, 2024
9fbf2bf
Merge branch 'main' into feat/bff
snaerseljan Oct 24, 2024
a0ef8df
Removed un used import
snaerseljan Oct 23, 2024
9fcf39b
Update after self review
snaerseljan Oct 24, 2024
22cd367
fix feature deployment url
snaerseljan Oct 28, 2024
0980954
Merge branch 'main' into feat/bff
snaerseljan Oct 28, 2024
32b0746
fix tests
snaerseljan Oct 28, 2024
eb91818
fix missing logger
snaerseljan Oct 28, 2024
c0d875f
chore: nx format:write update dirty files
andes-it Oct 28, 2024
12f4b66
Merge branch 'main' into feat/bff
snaerseljan Oct 28, 2024
4b40af7
merge with featbff and main
snaerseljan Oct 28, 2024
ef2ad3c
update api graphql bff config env var
snaerseljan Oct 28, 2024
ff14292
update api graphql bff config env var
snaerseljan Oct 28, 2024
b8402bd
fix tests
snaerseljan Oct 28, 2024
3d7e7e4
fix tests
snaerseljan Oct 28, 2024
244c79b
chore: charts update dirty files
andes-it Oct 28, 2024
37613bf
chore: nx format:write update dirty files
andes-it Oct 28, 2024
8e58bb6
grantnamespaces
snaerseljan Oct 29, 2024
133e006
chore: charts update dirty files
andes-it Oct 29, 2024
5e28215
Merge branch 'feat/bff' into feat/bff-my-pages
snaerseljan Oct 29, 2024
6432c0c
grantnamespace identity server
snaerseljan Oct 29, 2024
2218c31
chore: charts update dirty files
andes-it Oct 29, 2024
f19f501
disable global auth on dev
snaerseljan Oct 29, 2024
5ccc148
disable global auth on dev
snaerseljan Oct 29, 2024
e23c727
chore: charts update dirty files
andes-it Oct 29, 2024
02b2c52
Fix UserMenu test
snaerseljan Oct 29, 2024
1a829fc
fix portal core tests
snaerseljan Oct 29, 2024
2c024b1
test: update bff tests
busla Oct 30, 2024
cf2d259
test: fix scope bad placement
busla Oct 30, 2024
3ddca7e
fix: minor cleanup
busla Oct 30, 2024
7708154
chore: nx format:write update dirty files
andes-it Oct 30, 2024
fd2ca55
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 1, 2024
b73a9bb
chore: charts update dirty files
andes-it Nov 1, 2024
3f74e60
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 5, 2024
210160c
Add authority string to bff state
snaerseljan Nov 7, 2024
ad315eb
update to new bff hooks
snaerseljan Nov 7, 2024
44b3c52
Revert "Merge branch 'main' into feat/bff-my-pages"
snaerseljan Nov 7, 2024
7e4c0b0
merge with main
snaerseljan Nov 7, 2024
37b2b2e
chore: charts update dirty files
andes-it Nov 7, 2024
c16c285
chore: nx format:write update dirty files
andes-it Nov 7, 2024
bdb749f
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 8, 2024
d46b836
Update hooks
snaerseljan Nov 8, 2024
e06cd3e
chore: charts update dirty files
andes-it Nov 8, 2024
d1b0bfc
Update formSubmit handler to proxy bff requests and add external post…
snaerseljan Nov 11, 2024
adc397f
Fix test
snaerseljan Nov 11, 2024
94a5f5b
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 11, 2024
1f9f1b1
Small fixes
snaerseljan Nov 11, 2024
6d111a5
chore: rebuild
busla Nov 11, 2024
2467424
Merge branch 'main' into feat/bff-my-pages
busla Nov 12, 2024
5d10f46
update hook after bff addon
snaerseljan Nov 12, 2024
db90ba8
Remove unused commit
snaerseljan Nov 12, 2024
5cfa3ba
Add issuer to my-pages
snaerseljan Nov 12, 2024
242bf41
chore: charts update dirty files
andes-it Nov 12, 2024
a868c31
chore: nx format:write update dirty files
andes-it Nov 12, 2024
d1e9df5
remove unused env var from my pages infra
snaerseljan Nov 12, 2024
cc4d5d3
chore: charts update dirty files
andes-it Nov 12, 2024
c733ab7
Introduce legacy user info hook until application system has implemen…
snaerseljan Nov 14, 2024
a24e355
fix merge conflicts with main after big service portal update
snaerseljan Nov 15, 2024
ac807ea
chore: charts update dirty files
andes-it Nov 15, 2024
e0ce192
Add useLegacyAuth hook to support both contexts
snaerseljan Nov 15, 2024
57d60fd
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 15, 2024
41a9e22
Revert back to bff only hooks
snaerseljan Nov 18, 2024
5fe0363
Update global prefix path for my pages
snaerseljan Nov 19, 2024
ef1a54f
Fix bff creator logic
snaerseljan Nov 19, 2024
f730aeb
fix tests
snaerseljan Nov 19, 2024
5e0891b
chore: charts update dirty files
andes-it Nov 19, 2024
2f98dc3
fix tests
snaerseljan Nov 19, 2024
4f2361f
chore: charts update dirty files
andes-it Nov 19, 2024
530ed33
update charts build error
snaerseljan Nov 20, 2024
b40ac7a
console.error if no download url is found
snaerseljan Nov 20, 2024
d6d770a
fix document type check
snaerseljan Nov 20, 2024
ca55bf7
fix infra paths
snaerseljan Nov 21, 2024
0932fb9
chore: charts update dirty files
andes-it Nov 21, 2024
72e26f3
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 21, 2024
5be0731
feat(application-system-form): Update application-system to use bff (…
snaerseljan Nov 21, 2024
cd75ae6
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 22, 2024
96d9149
update application system ui tests
snaerseljan Nov 22, 2024
f496701
Fix tests
snaerseljan Nov 22, 2024
e69df1d
fix islandis build error
snaerseljan Nov 22, 2024
831d764
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 22, 2024
1558a81
Merge branch 'main' into feat/bff-my-pages
busla Nov 25, 2024
590ab0b
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 25, 2024
a2086da
Extend Redis cache keys to be unique between bffs since using same Re…
snaerseljan Nov 26, 2024
39cd9a9
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 26, 2024
f3280e8
Add deprecation messages to old hooks
snaerseljan Nov 26, 2024
ec6556b
Fix warning
snaerseljan Nov 26, 2024
46dcfb0
Fix tests and change separator for cache key
snaerseljan Nov 26, 2024
8543498
Remove redundant config
snaerseljan Nov 27, 2024
3216f62
Remove options from mock
snaerseljan Nov 27, 2024
39fbef1
Fix potential body error
snaerseljan Nov 27, 2024
3f2b8ff
Make sure that bff scopes are uniq
snaerseljan Nov 27, 2024
f32fe2b
chore: nx format:write update dirty files
andes-it Nov 27, 2024
2d8df14
Include targetLinkUrl in error redirects
snaerseljan Nov 27, 2024
13dc8ee
Update base bff infra to be strict about allowed redirect uris
snaerseljan Nov 28, 2024
8f8b1b2
Use bff hooks instead in old auth lib
snaerseljan Nov 28, 2024
4e1a2b1
Add comment about birthday hook and remove user type from isDelegatio…
snaerseljan Nov 28, 2024
3a62c2b
Remove optional check on profile
snaerseljan Nov 28, 2024
97abf94
Update bff redirect url logic
snaerseljan Nov 28, 2024
36f6ca7
fix merge conflicts with main
snaerseljan Nov 28, 2024
4cddf6a
fix accidental scope switch
snaerseljan Nov 28, 2024
cdb15bf
chore: charts update dirty files
andes-it Nov 28, 2024
659e38f
Update prod url for allowed redirect uris
snaerseljan Nov 28, 2024
369a389
chore: charts update dirty files
andes-it Nov 28, 2024
28defb5
Move comment above hook
snaerseljan Nov 28, 2024
24a8646
Update redirect uris
snaerseljan Nov 28, 2024
9e67aff
fix tests
snaerseljan Nov 28, 2024
ca7ebb3
chore: charts update dirty files
andes-it Nov 28, 2024
0fe102f
Fix prod being null
snaerseljan Nov 28, 2024
f9d8049
chore: charts update dirty files
andes-it Nov 28, 2024
5726e12
Fix prod url being null when using ctx.env.domain
snaerseljan Nov 28, 2024
715047f
chore: charts update dirty files
andes-it Nov 28, 2024
29dff8a
Prod url fix
snaerseljan Nov 29, 2024
e438258
chore: charts update dirty files
andes-it Nov 29, 2024
cc30840
Revert removed auth context
snaerseljan Nov 29, 2024
7ddfd0b
fix merge conflicts
snaerseljan Nov 29, 2024
46b1319
chore: nx format:write update dirty files
andes-it Nov 29, 2024
bc062c0
Merge branch 'main' into feat/bff-my-pages
snaerseljan Nov 29, 2024
ee3ab58
Merge branch 'main' into feat/bff-my-pages
snaerseljan Dec 2, 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
15 changes: 1 addition & 14 deletions apps/application-system/form/infra/application-system-form.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import { ref, service, ServiceBuilder } from '../../../../infra/src/dsl/dsl'

export const serviceSetup = (services: {
api: ServiceBuilder<'api'>
}): ServiceBuilder<'application-system-form'> =>
export const serviceSetup = (): ServiceBuilder<'application-system-form'> =>
snaerseljan marked this conversation as resolved.
Show resolved Hide resolved
service('application-system-form')
.namespace('application-system')
.liveness('/liveness')
.readiness('/readiness')
.env({
BASEPATH: '/umsoknir',
SI_PUBLIC_GRAPHQL_PATH: {
obmagnusson marked this conversation as resolved.
Show resolved Hide resolved
dev: '',
prod: '',
staging: '',
local: ref((h) => `http://${h.svc(services.api)}`),
},
SI_PUBLIC_IDENTITY_SERVER_ISSUER_URL: {
dev: 'https://identity-server.dev01.devland.is',
staging: 'https://identity-server.staging01.devland.is',
prod: 'https://innskra.island.is',
},
SI_PUBLIC_ENVIRONMENT: ref((h) => h.env.type),
})
.secrets({
Expand Down
19 changes: 18 additions & 1 deletion apps/application-system/form/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"executor": "@nx/webpack:dev-server",
"options": {
"port": 4242,
"buildTarget": "application-system-form:build"
"buildTarget": "application-system-form:build",
"proxyConfig": "apps/application-system/form/proxy.config.json"
},
"configurations": {
"production": {
Expand Down Expand Up @@ -103,16 +104,32 @@
"parallel": false
}
},
"start-bff": {
"executor": "nx:run-commands",
"options": {
"commands": [
"node -r esbuild-register src/cli/cli.ts run-local-env services-bff-portals-my-pages"
],
"cwd": "infra"
}
},
"dev": {
"executor": "nx:run-commands",
"options": {
"commands": [
"yarn nx run application-system-api:dev",
"yarn nx run service-portal:start-bff",
"yarn start application-system-form"
snaerseljan marked this conversation as resolved.
Show resolved Hide resolved
],
"parallel": true
}
},
"mock": {
"executor": "nx:run-commands",
"options": {
"commands": ["API_MOCKS=true yarn start application-system-form"]
}
},
"docker-static": {
"executor": "Intentionally left blank, only so this target is valid when using `nx show projects --with-target docker-static`"
}
Expand Down
6 changes: 6 additions & 0 deletions apps/application-system/form/proxy.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"/bff/*": {
"target": "http://localhost:3010",
"secure": false
}
}
25 changes: 18 additions & 7 deletions apps/application-system/form/src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
import { ApolloProvider } from '@apollo/client'

import { initializeClient } from '@island.is/application/graphql'
import { client } from '@island.is/application/graphql'
import { LocaleProvider } from '@island.is/localization'
import { defaultLanguage } from '@island.is/shared/constants'
import { AuthProvider } from '@island.is/auth/react'
import { FeatureFlagProvider } from '@island.is/react/feature-flags'
import { defaultLanguage } from '@island.is/shared/constants'

import { applicationSystemScopes } from '@island.is/auth/scopes'
import { BffProvider, createMockedInitialState } from '@island.is/react-spa/bff'
import { Router } from '../components/Router'
import { environment } from '../environments'
import { BASE_PATH } from '../lib/routes'
import { Router } from '../components/Router'
import { isMockMode } from '../mocks'

const mockedInitialState = isMockMode
? createMockedInitialState({
scopes: applicationSystemScopes,
})
: undefined

export const App = () => (
<ApolloProvider client={initializeClient(environment.baseApiUrl)}>
<ApolloProvider client={client}>
<LocaleProvider locale={defaultLanguage} messages={{}}>
<AuthProvider basePath={BASE_PATH}>
<BffProvider
applicationBasePath={BASE_PATH}
mockedInitialState={mockedInitialState}
>
<FeatureFlagProvider sdkKey={environment.featureFlagSdkKey}>
<Router />
</FeatureFlagProvider>
</AuthProvider>
</BffProvider>
</LocaleProvider>
</ApolloProvider>
)
Expand Down
57 changes: 0 additions & 57 deletions apps/application-system/form/src/auth.ts

This file was deleted.

10 changes: 5 additions & 5 deletions apps/application-system/form/src/components/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { createBrowserRouter, RouterProvider } from 'react-router-dom'

import { useAuth } from '@island.is/auth/react'
import { LoadingScreen } from '@island.is/react/components'
import { BASE_PATH, routes } from '../lib/routes'
import React, { useRef } from 'react'
import { useLocale } from '@island.is/localization'
import { useUserInfo } from '@island.is/react-spa/bff'
import { LoadingScreen } from '@island.is/react/components'
import { useRef } from 'react'
import { m } from '../lib/messages'
import { BASE_PATH, routes } from '../lib/routes'

export const Router = () => {
const { formatMessage } = useLocale()
const { userInfo } = useAuth()
const userInfo = useUserInfo()
const router = useRef<ReturnType<typeof createBrowserRouter>>()

if (!userInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import { getStaticEnv } from '@island.is/shared/utils'

const devConfig = {
production: false,
baseApiUrl: 'http://localhost:4444',
identityServer: {
authority: 'https://identity-server.dev01.devland.is',
},
featureFlagSdkKey: 'YcfYCOwBTUeI04mWOWpPdA/KgCHhUk0_k2BdiKMaNh3qA',
DD_RUM_CLIENT_TOKEN: 'unknown',
DD_RUM_APPLICATION_ID: 'unknown',
Expand All @@ -15,10 +11,6 @@ const devConfig = {

const prodConfig = {
production: true,
baseApiUrl: getStaticEnv('SI_PUBLIC_GRAPHQL_PATH') ?? window.location.origin,
identityServer: {
authority: getStaticEnv('SI_PUBLIC_IDENTITY_SERVER_ISSUER_URL'),
},
featureFlagSdkKey: getStaticEnv('SI_PUBLIC_CONFIGCAT_SDK_KEY'),
DD_RUM_CLIENT_TOKEN: getStaticEnv('SI_PUBLIC_DD_RUM_CLIENT_TOKEN'),
DD_RUM_APPLICATION_ID: getStaticEnv('SI_PUBLIC_DD_RUM_APPLICATION_ID'),
Expand Down
4 changes: 2 additions & 2 deletions apps/application-system/form/src/lib/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Outlet, RouteObject } from 'react-router-dom'

import { UserProfileLocale } from '@island.is/shared/components'
import { ErrorShell, HeaderInfoProvider } from '@island.is/application/ui-shell'
import { UserProfileLocale } from '@island.is/shared/components'

import { Layout } from '../components/Layout/Layout'
import { Application } from '../routes/Application'
import { Applications } from '../routes/Applications'
import { AssignApplication } from '../routes/AssignApplication'
import { Layout } from '../components/Layout/Layout'

export const BASE_PATH = '/umsoknir'

Expand Down
8 changes: 3 additions & 5 deletions apps/application-system/form/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import '@island.is/api/mocks'
import React, { StrictMode } from 'react'
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'

import { isRunningOnEnvironment } from '@island.is/shared/utils'

import './auth'

import { environment } from './environments'
import App from './app/App'
import { userMonitoring } from '@island.is/user-monitoring'
import App from './app/App'
import { environment } from './environments'

if (!isRunningOnEnvironment('local')) {
userMonitoring.initDdRum({
Expand Down
1 change: 1 addition & 0 deletions apps/application-system/form/src/mocks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const isMockMode = process.env.API_MOCKS === 'true'
6 changes: 3 additions & 3 deletions apps/application-system/form/src/routes/Application.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useParams } from 'react-router-dom'

import { coreMessages } from '@island.is/application/core'
import { ApplicationForm, ErrorShell } from '@island.is/application/ui-shell'
import { useLocale } from '@island.is/localization'
import { coreMessages } from '@island.is/application/core'
import { useAuth } from '@island.is/auth/react'
import { useUserInfo } from '@island.is/react-spa/bff'
snaerseljan marked this conversation as resolved.
Show resolved Hide resolved

type UseParams = {
slug: string
Expand All @@ -12,7 +12,7 @@ type UseParams = {

export const Application = () => {
const { slug, id } = useParams() as UseParams
const { userInfo } = useAuth()
const userInfo = useUserInfo()
const { formatMessage } = useLocale()
const nationalRegistryId = userInfo?.profile?.nationalId

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export class DocumentController {
rawDocumentDTO.fileName
}.pdf`,
)
res.header('Pragma: no-cache')
res.header('Cache-Control: no-cache')
res.header('Cache-Control: nmax-age=0')
res.header('Pragma', 'no-cache')
res.header('Cache-Control', 'no-cache')
res.header('Cache-Control', 'nmax-age=0')

return res.end(buffer)
}
Expand Down
5 changes: 0 additions & 5 deletions apps/portals/admin/infra/portals-admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ export const serviceSetup = (): ServiceBuilder<'portals-admin'> =>
})
.env({
BASEPATH: '/stjornbord',
SI_PUBLIC_IDENTITY_SERVER_ISSUER_URL: {
dev: 'https://identity-server.dev01.devland.is',
staging: 'https://identity-server.staging01.devland.is',
prod: 'https://innskra.island.is',
},
SI_PUBLIC_ENVIRONMENT: ref((h) => h.env.type),
})
.secrets({
Expand Down
2 changes: 1 addition & 1 deletion apps/portals/admin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
]
}
},
"mockmode": {
"mock": {
"executor": "nx:run-commands",
"options": {
"commands": ["API_MOCKS=true yarn start portals-admin"]
Expand Down
3 changes: 2 additions & 1 deletion apps/portals/admin/src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ApolloProvider } from '@apollo/client'
import { adminPortalScopes } from '@island.is/auth/scopes'
import { LocaleProvider } from '@island.is/localization'
import {
ApplicationErrorBoundary,
Expand All @@ -13,7 +14,6 @@ import { client } from '../graphql'
import { modules } from '../lib/modules'
import { AdminPortalPaths } from '../lib/paths'
import { createRoutes } from '../lib/routes'
import { adminPortalScopes } from '@island.is/auth/scopes'

const mockedInitialState = isMockMode
? createMockedInitialState({
Expand All @@ -27,6 +27,7 @@ export const App = () => (
<ApplicationErrorBoundary>
<BffProvider
applicationBasePath={AdminPortalPaths.Base}
bffGlobalPrefix={`${AdminPortalPaths.Base}/bff`}
mockedInitialState={mockedInitialState}
>
<FeatureFlagProvider sdkKey={environment.featureFlagSdkKey}>
Expand Down
6 changes: 0 additions & 6 deletions apps/portals/admin/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { getStaticEnv } from '@island.is/shared/utils'

const devConfig = {
production: false,
identityServer: {
authority: 'https://identity-server.dev01.devland.is',
},
featureFlagSdkKey: 'YcfYCOwBTUeI04mWOWpPdA/KgCHhUk0_k2BdiKMaNh3qA',
DD_RUM_CLIENT_TOKEN: 'unknown',
DD_RUM_APPLICATION_ID: 'unknown',
Expand All @@ -14,9 +11,6 @@ const devConfig = {

const prodConfig = {
production: true,
identityServer: {
authority: getStaticEnv('SI_PUBLIC_IDENTITY_SERVER_ISSUER_URL'),
},
featureFlagSdkKey: getStaticEnv('SI_PUBLIC_CONFIGCAT_SDK_KEY'),
DD_RUM_CLIENT_TOKEN: getStaticEnv('SI_PUBLIC_DD_RUM_CLIENT_TOKEN'),
DD_RUM_APPLICATION_ID: getStaticEnv('SI_PUBLIC_DD_RUM_APPLICATION_ID'),
Expand Down
15 changes: 1 addition & 14 deletions apps/portals/my-pages/infra/portals-my-pages.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { ref, service, ServiceBuilder } from '../../../../infra/src/dsl/dsl'

export const serviceSetup = (services: {
graphql: ServiceBuilder<'api'>
}): ServiceBuilder<'service-portal'> =>
export const serviceSetup = (): ServiceBuilder<'service-portal'> =>
service('service-portal')
.namespace('service-portal')
.liveness('/liveness')
Expand All @@ -18,18 +16,7 @@ export const serviceSetup = (services: {
})
.env({
BASEPATH: '/minarsidur',
SI_PUBLIC_IDENTITY_SERVER_ISSUER_URL: {
dev: 'https://identity-server.dev01.devland.is',
staging: 'https://identity-server.staging01.devland.is',
prod: 'https://innskra.island.is',
},
SI_PUBLIC_ENVIRONMENT: ref((h) => h.env.type),
SI_PUBLIC_GRAPHQL_API: {
prod: '/api/graphql',
staging: '/api/graphql',
dev: '/api/graphql',
local: ref((h) => `http://${h.svc(services.graphql)}/api/graphql`),
},
})
.secrets({
SI_PUBLIC_CONFIGCAT_SDK_KEY: '/k8s/configcat/CONFIGCAT_SDK_KEY',
Expand Down
Loading
Loading