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

release(v0.56.0): merge to prod #1050

Merged
merged 11 commits into from
Dec 6, 2023
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,23 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v0.56.0](https://github.com/isomerpages/isomercms-backend/compare/v0.55.0...v0.56.0)

- fix(rollback handler): convert to ts for safety [`#1044`](https://github.com/isomerpages/isomercms-backend/pull/1044)
- test(gitCommitService): add test cases [`#1047`](https://github.com/isomerpages/isomercms-backend/pull/1047)
- feat(gitFileSystem): safer api [`#1046`](https://github.com/isomerpages/isomercms-backend/pull/1046)
- test(githubService): add tests [`#1045`](https://github.com/isomerpages/isomercms-backend/pull/1045)
- chore(quickie): delete quickie for gh [`#1043`](https://github.com/isomerpages/isomercms-backend/pull/1043)
- feat(quickie): only gitfile should have quickie [`#1042`](https://github.com/isomerpages/isomercms-backend/pull/1042)
- hotfix(repair-form): set remote url correctly [`#1048`](https://github.com/isomerpages/isomercms-backend/pull/1048)
- build(deps): bump sequelize-typescript from 2.1.5 to 2.1.6 [`#1041`](https://github.com/isomerpages/isomercms-backend/pull/1041)
- Added swagger doc for GIG DNS API [`#1017`](https://github.com/isomerpages/isomercms-backend/pull/1017)
- 0.55.0 [`#1039`](https://github.com/isomerpages/isomercms-backend/pull/1039)

#### [v0.55.0](https://github.com/isomerpages/isomercms-backend/compare/v0.54.0...v0.55.0)

> 16 November 2023

- fix(siteCreate): add redirect rules [`#1036`](https://github.com/isomerpages/isomercms-backend/pull/1036)
- chore: remove extra and unused submodules [`#1031`](https://github.com/isomerpages/isomercms-backend/pull/1031)
- release/0.54.0 [`#1033`](https://github.com/isomerpages/isomercms-backend/pull/1033)
Expand All @@ -21,6 +36,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix(pagination): images fix pagination [`#1026`](https://github.com/isomerpages/isomercms-backend/pull/1026)
- fix(media): change media sorting to addedTime descending [`#1019`](https://github.com/isomerpages/isomercms-backend/pull/1019)
- 0.53.0 [`#1024`](https://github.com/isomerpages/isomercms-backend/pull/1024)
- fix(mediafileservice): disable sneky cloudmersive [`#1025`](https://github.com/isomerpages/isomercms-backend/pull/1025)
- release(0.52.0): merge to prod [`#1013`](https://github.com/isomerpages/isomercms-backend/pull/1013)
- Release/0.51.0 [`#1002`](https://github.com/isomerpages/isomercms-backend/pull/1002)
- * refactor(formsg-site-clone): remove and add to site creation (#971) [`#992`](https://github.com/isomerpages/isomercms-backend/pull/992)
Expand Down Expand Up @@ -94,7 +110,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

> 9 November 2023

- fix(mediafileservice): disable sneky cloudmersive [`#1025`](https://github.com/isomerpages/isomercms-backend/pull/1025)
- fix(file ext): fix casing + better logging [`#1020`](https://github.com/isomerpages/isomercms-backend/pull/1020)
- fix(rr): capture file extensions that are in uppercase [`#1016`](https://github.com/isomerpages/isomercms-backend/pull/1016)
- release(0.52.0): merge to develop [`#1012`](https://github.com/isomerpages/isomercms-backend/pull/1012)
Expand Down
230 changes: 230 additions & 0 deletions docs/gigDnsApi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
openapi: 3.0.0
info:
version: "1.0.0"
title: "GIG DNS Management API"
description: "An API to manage DNS records for GovTech Domains"

paths:
/dns-records:
post:
summary: Add a DNS record
description: Add a DNS record of various types to the DNS management system along with a contact email.
security:
- ApiKeyAuth: []
parameters:
- in: header
name: X-API-KEY
required: true
schema:
type: string
description: API key required to authorize requests.
example: "1234567890abcdef"
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- email
- record
properties:
email:
type: string
format: email
description: The contact email address for this DNS record.
record:
$ref: "#/components/schemas/DNSRecord"
example:
email: "[email protected]"
record:
type: "A"
name: "example.com"
content: "192.168.1.1"
responses:
"201":
description: DNS record successfully added.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "DNS record added successfully."
"401":
description: Unauthorized.
"400":
description: Invalid request data.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Invalid data provided."
"500":
description: Server error.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Internal server error."
get:
summary: Retrieve DNS records
description: Get a list of DNS records for a specified name.
parameters:
- in: query
name: name
required: true
schema:
type: string
description: The name of the DNS record to retrieve.
responses:
"200":
description: A list of DNS records.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/DNSRecord"
"401":
description: Unauthorized.
"404":
description: No records found for the specified name.
delete:
summary: Delete a DNS record by name and type
description: Delete a specific DNS record identified by its name and type.
parameters:
- in: query
name: name
required: true
schema:
type: string
description: The name of the DNS record to be deleted.
- in: query
name: type
required: true
schema:
type: string
enum:
[
"A",
"AAAA",
"CNAME",
"TXT",
"SRV",
"LOC",
"MX",
"NS",
"SPF",
"CAA",
"DNSKEY",
"DS",
]
description: The type of the DNS record to be deleted.
responses:
"200":
description: DNS record successfully deleted.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "DNS record successfully deleted"
"401":
description: Unauthorized.
"404":
description: DNS record not found.
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-KEY
description: API key required to authorize requests.
schemas:
DNSRecord:
type: object
required:
- type
- name
- content
properties:
type:
type: string
description: The type of the DNS record.
enum:
[
"A",
"AAAA",
"CNAME",
"TXT",
"SRV",
"LOC",
"MX",
"NS",
"SPF",
"CAA",
"DNSKEY",
"DS",
]
name:
type: string
description: The name of the DNS record.
content:
oneOf:
- type: string
- $ref: "#/components/schemas/DNSKEYData"
- $ref: "#/components/schemas/DSData"
description: The content of the DNS record. Varies depending on the record type.
priority:
type: integer
description: Priority of the record (used for MX and SRV records).
DNSKEYData:
type: object
required:
- flags
- protocol
- algorithm
- publicKey
properties:
flags:
type: integer
description: An unsigned 16-bit integer representing DNSKEY flags.
protocol:
type: integer
description: The protocol field. Should always be 3.
algorithm:
type: integer
description: An 8-bit integer identifying the DNSKEY's cryptographic algorithm.
publicKey:
type: string
description: The public key material, encoded in Base64.
DSData:
type: object
required:
- keyTag
- algorithm
- digestType
- digest
properties:
keyTag:
type: integer
description: An unsigned 16-bit integer representing the key tag.
algorithm:
type: integer
description: An 8-bit integer identifying the DS record's cryptographic algorithm.
digestType:
type: integer
description: An 8-bit integer representing the type of the digest.
digest:
type: string
description: The digest value, encoded in Base64.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isomercms",
"version": "0.55.0",
"version": "0.56.0",
"private": true,
"scripts": {
"build": "tsc -p tsconfig.build.json",
Expand Down Expand Up @@ -82,7 +82,7 @@
"query-string": "^6.14.1",
"reflect-metadata": "^0.1.13",
"sequelize": "^6.29.0",
"sequelize-typescript": "^2.1.3",
"sequelize-typescript": "^2.1.6",
"serialize-error": "^7.0.1",
"simple-git": "^3.19.1",
"slugify": "^1.6.0",
Expand Down
19 changes: 19 additions & 0 deletions src/fixtures/sessionData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import GithubSessionData from "@root/classes/GithubSessionData"
import UserSessionData from "@root/classes/UserSessionData"
import UserWithSiteSessionData from "@root/classes/UserWithSiteSessionData"
import { FeatureFlags } from "@root/types/featureFlags"
import { RawGitTreeEntry } from "@root/types/github"

import {
MOCK_USER_EMAIL_ONE,
Expand All @@ -25,6 +26,24 @@ export const mockCurrentCommitSha = "mockCurrentCommitSha"
export const mockSiteName = "mockSiteName"
export const mockGrowthBook = new GrowthBook<FeatureFlags>()

export const gitTree: RawGitTreeEntry[] = [
{
path: "directory/file1.txt",
type: "tree",
sha: "fake-sha-1",
mode: "100644",
url: "fake-url-1",
},
{
path: "directory/file2.txt",
type: "file",
sha: "fake-sha-2",
mode: "100644",
url: "fake-url-2",
size: 100,
},
]

export const mockGithubState = {
treeSha: mockTreeSha,
currentCommitSha: mockCurrentCommitSha,
Expand Down
3 changes: 0 additions & 3 deletions src/integration/Notifications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {
import { getAuthorizationMiddleware } from "@root/middleware"
import { NotificationsRouter as _NotificationsRouter } from "@root/routes/v2/authenticated/notifications"
import GitFileCommitService from "@root/services/db/GitFileCommitService"
import GitHubCommitService from "@root/services/db/GithubCommitService"
import { BaseDirectoryService } from "@root/services/directoryServices/BaseDirectoryService"
import { ResourceRoomDirectoryService } from "@root/services/directoryServices/ResourceRoomDirectoryService"
import { CollectionPageService } from "@root/services/fileServices/MdPageServices/CollectionPageService"
Expand Down Expand Up @@ -71,12 +70,10 @@ const MOCK_SITE_MEMBER_ID = "1"

const gitFileSystemService = new GitFileSystemService(simpleGit())
const gitFileCommitService = new GitFileCommitService(gitFileSystemService)
const gitHubCommitService = new GitHubCommitService(isomerRepoAxiosInstance)
const gitHubService = new RepoService({
isomerRepoAxiosInstance,
gitFileSystemService,
gitFileCommitService,
gitHubCommitService,
})
const identityAuthService = getIdentityAuthService(gitHubService)
const usersService = getUsersService(sequelize)
Expand Down
Loading
Loading