Skip to content

Commit

Permalink
Merge branch 'main' into chore/delegation-index-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
baering committed Oct 17, 2024
2 parents eca2b68 + 18b2931 commit 0055bc2
Show file tree
Hide file tree
Showing 292 changed files with 8,439 additions and 3,836 deletions.
7 changes: 0 additions & 7 deletions apps/air-discount-scheme/api/infra/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ export const serviceSetup = (services: {
staging: ['loftbru', 'loftbru-cf'],
prod: ['loftbru'],
},
extraAnnotations: {
dev: {},
staging: {},
prod: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
},
paths: ['/api/graphql'],
public: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export const serviceSetup = (): ServiceBuilder<'air-discount-scheme-backend'> =>
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
prod: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
prod: {},
},
paths: ['/api/swagger', '/api/public'],
},
Expand Down
7 changes: 0 additions & 7 deletions apps/api/infra/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,6 @@ export const serviceSetup = (services: {
prod: ['', 'www.island.is'],
},
paths: ['/api'],
extraAnnotations: {
dev: {},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
prod: {},
},
public: true,
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ export class TemplateApiApplicationService extends BaseTemplateApiApplicationSer
const s3key = `${application.id}/${attachmentKey}`
const url = await this.awsService.uploadFile(
buffer,
uploadBucket,
s3key,
{ bucket: uploadBucket, key: s3key },
uploadParameters,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const serviceSetup = (services: {
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
Expand Down
1 change: 0 additions & 1 deletion apps/consultation-portal/infra/samradsgatt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const serviceSetup = (services: {
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
Expand Down
7 changes: 0 additions & 7 deletions apps/contentful-apps/infra/contentful-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ export const serviceSetup = (): ServiceBuilder<'contentful-apps'> =>
prod: 'contentful-apps',
},
paths: ['/'],
extraAnnotations: {
dev: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
staging: {},
prod: {},
},
},
})
.replicaCount({
Expand Down
7 changes: 0 additions & 7 deletions apps/download-service/infra/download-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ export const serviceSetup = (services: {
prod: ['api'],
},
paths: ['/download'],
extraAnnotations: {
dev: {},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
prod: {},
},
public: true,
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const AidAmountModal = ({
onVisibilityChange,
calculations,
}: Props) => {
const closeModal = (): void => {
const closeModal = () => {
onVisibilityChange(false)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useMemo, useContext } from 'react'
import React, { useState, useMemo } from 'react'
import cn from 'classnames'
import format from 'date-fns/format'

Expand Down
2 changes: 0 additions & 2 deletions apps/github-actions-cache/infra/github-actions-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export const serviceSetup = (): ServiceBuilder<'github-actions-cache'> => {
dev: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
staging: {},
prod: {},
},
public: true,
},
Expand Down
1 change: 0 additions & 1 deletion apps/portals/admin/infra/portals-admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const serviceSetup = (): ServiceBuilder<'portals-admin'> =>
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
Expand Down
1 change: 0 additions & 1 deletion apps/portals/my-pages/infra/portals-my-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export const serviceSetup = (services: {
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { getModelToken } from '@nestjs/sequelize'
import { faker } from '@island.is/shared/mocking'
import { TicketStatus, ZendeskService } from '@island.is/clients/zendesk'
import { NationalRegistryClientService } from '@island.is/clients/national-registry-v2'
import { ErrorCodes } from '@island.is/shared/utils'

const currentUser = createCurrentUser({
scope: [DelegationAdminScopes.read, DelegationAdminScopes.admin],
Expand Down Expand Up @@ -339,6 +340,85 @@ describe('DelegationAdmin - With authentication', () => {
expect(res.status).toEqual(400)
})

it('POST /delegation-admin should not create delegation since it already exists', async () => {
// Arrange
const { toNationalId, fromNationalId } = {
toNationalId: '0101302399',
fromNationalId: '0101307789',
}

mockZendeskService(toNationalId, fromNationalId)

const existingDelegation = await factory.createCustomDelegation({
fromNationalId,
toNationalId,
domainName: null,
scopes: [{ scopeName: 's1' }],
referenceId: 'ref1',
})

const delegation: CreatePaperDelegationDto = {
toNationalId: existingDelegation.toNationalId,
fromNationalId: existingDelegation.fromNationalId,
referenceId: 'ref2',
}

// Act
const res = await getRequestMethod(
server,
'POST',
)('/delegation-admin').send(delegation)

// Assert
expect(res.status).toEqual(400)
expect(res.body).toMatchObject({
status: 400,
type: 'https://httpstatuses.org/400',
title: ErrorCodes.COULD_NOT_CREATE_DELEGATION,
detail: 'Could not create delegation',
})
})

it('POST /delegation-admin should not create delegation since the delegation id already exists', async () => {
// Arrange
const { toNationalId, fromNationalId } = {
toNationalId: '0101302399',
fromNationalId: '0101307789',
}

mockZendeskService(fromNationalId, toNationalId)

const existingDelegation = await factory.createCustomDelegation({
fromNationalId,
toNationalId,
domainName: null,
scopes: [{ scopeName: 's1' }],
referenceId: 'ref1',
})

// Send in opposite national ids so they will not exist in db
const delegation: CreatePaperDelegationDto = {
toNationalId: existingDelegation.fromNationalId,
fromNationalId: existingDelegation.toNationalId,
referenceId: 'ref1',
}

// Act
const res = await getRequestMethod(
server,
'POST',
)('/delegation-admin').send(delegation)

// Assert
expect(res.status).toEqual(400)
expect(res.body).toMatchObject({
status: 400,
type: 'https://httpstatuses.org/400',
title: ErrorCodes.REFERENCE_ID_ALREADY_EXISTS,
detail: 'Delegation with the same reference id already exists',
})
})

it('POST /delegation-admin should not create delegation with incorrect zendesk ticket status', async () => {
// Arrange
mockZendeskService(toNationalId, fromNationalId, {
Expand Down
4 changes: 2 additions & 2 deletions apps/services/auth/ids-api/infra/identity-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ export const serviceSetup = (services: {
public: true,
extraAnnotations: {
dev: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
},
prod: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ export const serviceSetup =
prod: 'contentful-entry-tagger-service.devland.is',
},
paths: ['/'],
extraAnnotations: {
dev: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
prod: { 'nginx.ingress.kubernetes.io/enable-global-auth': 'false' },
},
},
})
.liveness('/liveness')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,10 @@ export class EndorsementListService {
await this.uploadFileToS3(fileBuffer, filename, fileType)

// Generate presigned URL with 60 minutes expiration
const url = await this.awsService.getPresignedUrl(
environment.exportsBucketName,
filename,
)
const url = await this.awsService.getPresignedUrl({
bucket: environment.exportsBucketName,
key: filename,
})
return { url }
} catch (error) {
this.logger.error(`Failed to export list ${listId}`, { error })
Expand Down Expand Up @@ -878,8 +878,7 @@ export class EndorsementListService {
try {
await this.awsService.uploadFile(
fileBuffer,
environment.exportsBucketName,
filename,
{ bucket: environment.exportsBucketName, key: filename },
{
ContentType: fileType === 'pdf' ? 'application/pdf' : 'text/csv',
},
Expand Down
7 changes: 0 additions & 7 deletions apps/services/license-api/infra/license-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ export const serviceSetup = (): ServiceBuilder<'license-api'> =>
},
paths: ['/'],
public: false,
extraAnnotations: {
dev: {},
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
prod: {},
},
},
})
.replicaCount({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const serviceSetup = (): ServiceBuilder<'search-indexer-service'> =>
staging: {
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
prod: { 'nginx.ingress.kubernetes.io/enable-global-auth': 'false' },
prod: {},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import { helpers } from '../../../../support/locator-helpers'
import { session } from '../../../../support/session'
import { setupXroadMocks } from './setup-xroad.mocks'
import { createMockPdf, deleteMockPdf } from '../../../../support/utils'

test.use({ baseURL: urls.islandisBaseUrl })

Expand Down Expand Up @@ -323,6 +324,19 @@ test.describe('Parental leave', () => {
name: label(parentalLeaveFormMessages.attachmentScreen.title),
}),
).toBeVisible()

// Upload additional document
createMockPdf()
const fileChooserPromise = page.waitForEvent('filechooser')
await page
.getByRole('button', {
name: label(parentalLeaveFormMessages.fileUpload.attachmentButton),
})
.click()
const filechooser = await fileChooserPromise
await filechooser.setFiles('./mockPdf.pdf')
await page.waitForTimeout(1000)
deleteMockPdf()
await proceed()

// These are your rights
Expand Down
1 change: 0 additions & 1 deletion apps/web/infra/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const serviceSetup = (services: {
prod: {
'nginx.ingress.kubernetes.io/proxy-buffering': 'on',
'nginx.ingress.kubernetes.io/proxy-buffer-size': '8k',
'nginx.ingress.kubernetes.io/enable-global-auth': 'false',
},
},
paths: ['/'],
Expand Down
3 changes: 0 additions & 3 deletions charts/islandis/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,6 @@ contentful-apps:
primary-alb:
annotations:
kubernetes.io/ingress.class: 'nginx-external-alb'
nginx.ingress.kubernetes.io/enable-global-auth: 'false'
nginx.ingress.kubernetes.io/service-upstream: 'true'
hosts:
- host: 'contentful-apps.dev01.devland.is'
Expand Down Expand Up @@ -1143,7 +1142,6 @@ contentful-entry-tagger-service:
primary-alb:
annotations:
kubernetes.io/ingress.class: 'nginx-external-alb'
nginx.ingress.kubernetes.io/enable-global-auth: 'false'
nginx.ingress.kubernetes.io/service-upstream: 'true'
hosts:
- host: 'contentful-entry-tagger-service.dev01.devland.is'
Expand Down Expand Up @@ -1647,7 +1645,6 @@ island-ui-storybook:
primary-alb:
annotations:
kubernetes.io/ingress.class: 'nginx-external-alb'
nginx.ingress.kubernetes.io/enable-global-auth: 'false'
nginx.ingress.kubernetes.io/service-upstream: 'true'
hosts:
- host: 'ui.dev01.devland.is'
Expand Down
Loading

0 comments on commit 0055bc2

Please sign in to comment.