Compare commits

...

6 Commits

16 changed files with 72 additions and 89 deletions

2
.github/ci.env vendored
View File

@@ -28,3 +28,5 @@ AUTH_SERVER_ENCRYPTION_SERVER_KEY=1087415dfde3093797f9a7ca93a49e7d7aa1861735eb0d
VALET_TOKEN_SECRET=4b886819ebe1e908077c6cae96311b48a8416bd60cc91c03060e15bdf6b30d1f
SYNCING_SERVER_CONTENT_SIZE_TRANSFER_LIMIT=100000
HTTP_REQUEST_PAYLOAD_LIMIT_MEGABYTES=1

View File

@@ -42,26 +42,26 @@ jobs:
workspace_name: ${{ inputs.workspace_name }}
secrets: inherit
deploy-web:
if: ${{ inputs.deploy_web }}
# deploy-web:
# if: ${{ inputs.deploy_web }}
needs: publish
# needs: publish
name: Deploy Web
uses: standardnotes/server/.github/workflows/common-deploy.yml@main
with:
service_name: ${{ inputs.service_name }}
docker_image: ${{ inputs.service_name }}:${{ github.sha }}
secrets: inherit
# name: Deploy Web
# uses: standardnotes/server/.github/workflows/common-deploy.yml@main
# with:
# service_name: ${{ inputs.service_name }}
# docker_image: ${{ inputs.service_name }}:${{ github.sha }}
# secrets: inherit
deploy-worker:
if: ${{ inputs.deploy_worker }}
# deploy-worker:
# if: ${{ inputs.deploy_worker }}
needs: publish
# needs: publish
name: Deploy Worker
uses: standardnotes/server/.github/workflows/common-deploy.yml@main
with:
service_name: ${{ inputs.service_name }}-worker
docker_image: ${{ inputs.service_name }}:${{ github.sha }}
secrets: inherit
# name: Deploy Worker
# uses: standardnotes/server/.github/workflows/common-deploy.yml@main
# with:
# service_name: ${{ inputs.service_name }}-worker
# docker_image: ${{ inputs.service_name }}:${{ github.sha }}
# secrets: inherit

View File

@@ -71,6 +71,7 @@ jobs:
echo "REFRESH_TOKEN_AGE=10" >> packages/home-server/.env
echo "REVISIONS_FREQUENCY=2" >> packages/home-server/.env
echo "CONTENT_SIZE_TRANSFER_LIMIT=100000" >> packages/home-server/.env
echo "HTTP_REQUEST_PAYLOAD_LIMIT_MEGABYTES=1" >> packages/home-server/.env
echo "DB_HOST=localhost" >> packages/home-server/.env
echo "DB_PORT=3306" >> packages/home-server/.env
echo "DB_DATABASE=standardnotes" >> packages/home-server/.env

View File

@@ -98,30 +98,32 @@ jobs:
- name: Test
run: yarn test
e2e-base:
needs: build
name: E2E Base Suite
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
with:
snjs_image_tag: 'latest'
suite: 'base'
# e2e-base:
# needs: build
# name: E2E Base Suite
# uses: standardnotes/server/.github/workflows/common-e2e.yml@main
# with:
# snjs_image_tag: 'latest'
# suite: 'base'
e2e-vaults:
needs: build
name: E2E Vaults Suite
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
with:
snjs_image_tag: 'latest'
suite: 'vaults'
# e2e-vaults:
# needs: build
# name: E2E Vaults Suite
# uses: standardnotes/server/.github/workflows/common-e2e.yml@main
# with:
# snjs_image_tag: 'latest'
# suite: 'vaults'
publish-self-hosting:
needs: [ test, lint, e2e-base, e2e-vaults ]
# needs: [ test, lint, e2e-base, e2e-vaults ]
needs: [ test, lint ]
name: Publish Self Hosting Docker Image
uses: standardnotes/server/.github/workflows/common-self-hosting.yml@main
secrets: inherit
publish-services:
needs: [ test, lint, e2e-base, e2e-vaults ]
# needs: [ test, lint, e2e-base, e2e-vaults ]
needs: [ test, lint ]
runs-on: ubuntu-latest

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.178.2](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.178.1...@standardnotes/auth-server@1.178.2) (2024-03-15)
### Bug Fixes
* allow handling of new api version ([9d49764](https://github.com/standardnotes/server/commit/9d49764b841e73655e19523eddf10498addc9fb4))
## [1.178.1](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.178.0...@standardnotes/auth-server@1.178.1) (2024-02-09)
### Bug Fixes
* allow expired offline subscriptions to receive dashboard emails ([#1041](https://github.com/standardnotes/server/issues/1041)) ([4fe8e9a](https://github.com/standardnotes/server/commit/4fe8e9a79f652f3e39608d6683cb17cc08bb8717))
# [1.178.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.177.20...@standardnotes/auth-server@1.178.0) (2024-01-19)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/auth-server",
"version": "1.178.0",
"version": "1.178.2",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -2,4 +2,5 @@ export enum ApiVersion {
v20161215 = '20161215',
v20190520 = '20190520',
v20200115 = '20200115',
v20240226 = '20240226',
}

View File

@@ -24,6 +24,7 @@ export class AuthResponseFactoryResolver implements AuthResponseFactoryResolverI
case ApiVersion.v20190520:
return this.authResponseFactory20190520
case ApiVersion.v20200115:
case ApiVersion.v20240226:
return this.authResponseFactory20200115
default:
return this.authResponseFactory20161215

View File

@@ -89,42 +89,4 @@ describe('CreateOfflineSubscriptionToken', () => {
expect(domainEventFactory.createEmailRequestedEvent).not.toHaveBeenCalled()
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
})
it('should not create an offline subscription token if email has a cancelled subscription', async () => {
offlineUserSubscriptionRepository.findOneByEmail = jest
.fn()
.mockReturnValue({ cancelled: true, endsAt: 100 } as jest.Mocked<OfflineUserSubscription>)
expect(
await createUseCase().execute({
userEmail: 'test@test.com',
}),
).toEqual({
success: false,
error: 'subscription-canceled',
})
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
expect(domainEventFactory.createEmailRequestedEvent).not.toHaveBeenCalled()
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
})
it('should not create an offline subscription token if email has an outdated subscription', async () => {
offlineUserSubscriptionRepository.findOneByEmail = jest
.fn()
.mockReturnValue({ cancelled: false, endsAt: 2 } as jest.Mocked<OfflineUserSubscription>)
expect(
await createUseCase().execute({
userEmail: 'test@test.com',
}),
).toEqual({
success: false,
error: 'subscription-expired',
})
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
expect(domainEventFactory.createEmailRequestedEvent).not.toHaveBeenCalled()
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
})
})

View File

@@ -37,20 +37,6 @@ export class CreateOfflineSubscriptionToken implements UseCaseInterface {
}
}
if (existingSubscription.cancelled) {
return {
success: false,
error: 'subscription-canceled',
}
}
if (existingSubscription.endsAt < this.timer.getTimestampInMicroseconds()) {
return {
success: false,
error: 'subscription-expired',
}
}
const token = await this.cryptoNode.generateRandomKey(128)
const offlineSubscriptionToken = {

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.22.65](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.22.64...@standardnotes/home-server@1.22.65) (2024-03-15)
**Note:** Version bump only for package @standardnotes/home-server
## [1.22.64](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.22.63...@standardnotes/home-server@1.22.64) (2024-02-09)
**Note:** Version bump only for package @standardnotes/home-server
## [1.22.63](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.22.62...@standardnotes/home-server@1.22.63) (2024-01-19)
**Note:** Version bump only for package @standardnotes/home-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/home-server",
"version": "1.22.63",
"version": "1.22.65",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.136.2](https://github.com/standardnotes/server/compare/@standardnotes/syncing-server@1.136.1...@standardnotes/syncing-server@1.136.2) (2024-03-15)
### Bug Fixes
* allow handling of new api version ([9d49764](https://github.com/standardnotes/server/commit/9d49764b841e73655e19523eddf10498addc9fb4))
## [1.136.1](https://github.com/standardnotes/server/compare/@standardnotes/syncing-server@1.136.0...@standardnotes/syncing-server@1.136.1) (2024-01-19)
**Note:** Version bump only for package @standardnotes/syncing-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/syncing-server",
"version": "1.136.1",
"version": "1.136.2",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -2,4 +2,5 @@ export enum ApiVersion {
v20161215 = '20161215',
v20190520 = '20190520',
v20200115 = '20200115',
v20240226 = '20240226',
}

View File

@@ -14,6 +14,7 @@ export class SyncResponseFactoryResolver implements SyncResponseFactoryResolverI
switch (apiVersion) {
case ApiVersion.v20190520:
case ApiVersion.v20200115:
case ApiVersion.v20240226:
return this.syncResponseFactory20200115
default:
return this.syncResponseFactory20161215