@bedrock/account-http
Advanced tools
Comparing version 7.1.1 to 7.1.2
# bedrock-account-http ChangeLog | ||
## 7.1.2 - 2023-10-24 | ||
### Fixed | ||
- Remove `turnstile` related changes released in `7.1.0` and `7.1.1`. Due to | ||
a Node.js 18+ requirement in related dependencies, this functionality must | ||
be added in a future major, breaking v8.x release. | ||
## 7.1.1 - 2023-10-20 | ||
@@ -4,0 +11,0 @@ |
@@ -10,9 +10,3 @@ /*! | ||
const cfg = config['account-http'] = { | ||
// account registration options | ||
registration: { | ||
// default to false, set name of service as string | ||
authorizationRequired: false | ||
} | ||
}; | ||
const cfg = config['account-http'] = {}; | ||
@@ -19,0 +13,0 @@ cfg.routes = { |
@@ -9,6 +9,4 @@ /*! | ||
import {asyncHandler} from '@bedrock/express'; | ||
import {authorizeRegistration} from './authorizations.js'; | ||
import boolParser from 'express-query-boolean'; | ||
import {createValidateMiddleware} from '@bedrock/validation'; | ||
import intParser from 'express-query-int'; | ||
@@ -48,6 +46,2 @@ import {v4 as uuid} from 'uuid'; | ||
if(cfg.registration.authorizationRequired.length > 0) { | ||
await authorizeRegistration({req}); | ||
} | ||
// anyone may create a new account; must be rate limited via another | ||
@@ -54,0 +48,0 @@ // means if necessary |
{ | ||
"name": "@bedrock/account-http", | ||
"version": "7.1.1", | ||
"version": "7.1.2", | ||
"type": "module", | ||
@@ -28,6 +28,4 @@ "description": "HTTP API for Bedrock User Accounts", | ||
"dependencies": { | ||
"@digitalbazaar/http-client": "^4.0.0", | ||
"express-query-boolean": "^2.0.0", | ||
"express-query-int": "^3.0.0", | ||
"forwarded": "^0.2.0", | ||
"uuid": "^9.0.0" | ||
@@ -40,3 +38,2 @@ }, | ||
"@bedrock/passport": "^11.0.0", | ||
"@bedrock/turnstile": "^1.0.1", | ||
"@bedrock/validation": "^7.0.0" | ||
@@ -43,0 +40,0 @@ }, |
@@ -13,17 +13,3 @@ /*! | ||
properties: { | ||
email: schemas.email(), | ||
authorization: { | ||
type: 'object', | ||
additionalProperties: false, | ||
required: ['type', 'token'], | ||
properties: { | ||
type: { | ||
type: 'string', | ||
enum: ['turnstile'] | ||
}, | ||
token: { | ||
type: 'string' | ||
} | ||
} | ||
} | ||
email: schemas.email() | ||
} | ||
@@ -30,0 +16,0 @@ }; |
@@ -88,18 +88,2 @@ /*! | ||
describe('post /', function() { | ||
it('should create account with authorization', async function() { | ||
config['account-http'].registration.authorizationRequired = 'turnstile'; | ||
const authorization = { | ||
token: 'XXXX.DUMMY.TOKEN.XXXX', | ||
type: 'turnstile' | ||
}; | ||
const email = {email: 'auth@digitalbazaar.com', authorization}; | ||
const result = await api.post('/', email); | ||
result.status.should.equal(201); | ||
config['account-http'].registration.authorizationRequired = false; | ||
}); | ||
it('should create account without authorization', async function() { | ||
const email = {email: 'noauth@digitalbazaar.com'}; | ||
const result = await api.post('/', email); | ||
result.status.should.equal(201); | ||
}); | ||
it('should return 400 if there is no email', async function() { | ||
@@ -111,5 +95,3 @@ const result = await api.post('/'); | ||
it('should return 201 if there is an email', async function() { | ||
const result = await api.post('/', { | ||
email: 'newuser@digitalbazaar.com' | ||
}); | ||
const result = await api.post('/', {email: 'newuser@digitalbazaar.com'}); | ||
result.status.should.equal(201); | ||
@@ -116,0 +98,0 @@ }); |
@@ -34,3 +34,2 @@ { | ||
"@bedrock/test": "^8.0.0", | ||
"@bedrock/turnstile": "^1.0.1", | ||
"@bedrock/validation": "^7.0.0", | ||
@@ -37,0 +36,0 @@ "apisauce": "^2.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
39531
16
723
- Removed@digitalbazaar/http-client@^4.0.0
- Removedforwarded@^0.2.0
- Removed@bedrock/https-agent@4.1.0(transitive)
- Removed@bedrock/turnstile@1.0.2(transitive)
- Removed@digitalbazaar/http-client@4.1.1(transitive)
- Removedky@1.7.2(transitive)
- Removedundici@6.21.0(transitive)