Skip to content

Commit 635f7b2

Browse files
author
CI Fix
committed
updates lib/api
1 parent 53c8278 commit 635f7b2

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

lib/api/accounts/user-accounts.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import express from 'express'
2-
import { urlencoded } from 'body-parser'
2+
import bodyParserPkg from 'body-parser'
3+
const { urlencoded } = bodyParserPkg
34
const bodyParser = urlencoded({ extended: false })
45
import debug from '../../debug.mjs'
56
const debugAccounts = debug.accounts
67

78
import restrictToTopDomain from '../../handlers/restrict-to-top-domain.mjs'
89

9-
import CreateAccountRequest from '../../requests/create-account-request.mjs'
10+
import { CreateAccountRequest } from '../../requests/create-account-request.mjs'
1011
import AddCertificateRequest from '../../requests/add-cert-request.mjs'
1112
import DeleteAccountRequest from '../../requests/delete-account-request.mjs'
1213
import DeleteAccountConfirmRequest from '../../requests/delete-account-confirm-request.mjs'

lib/api/authn/webid-oidc.mjs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
import express from 'express'
66
import { routeResolvedFile } from '../../utils.mjs'
7-
import { urlencoded } from 'body-parser'
7+
import bodyParserPkg from 'body-parser'
8+
const { urlencoded } = bodyParserPkg
89
const bodyParser = urlencoded({ extended: false })
9-
import OidcManager from '../../models/oidc-manager.mjs'
10+
import { fromServerConfig } from '../../models/oidc-manager.mjs'
1011
import { LoginRequest } from '../../requests/login-request.mjs'
1112
import { SharingRequest } from '../../requests/sharing-request.mjs'
1213

@@ -15,9 +16,10 @@ import restrictToTopDomain from '../../handlers/restrict-to-top-domain.mjs'
1516
import PasswordResetEmailRequest from '../../requests/password-reset-email-request.mjs'
1617
import PasswordChangeRequest from '../../requests/password-change-request.mjs'
1718

18-
import { createRequire } from 'module'
19-
const require = createRequire(import.meta.url)
20-
const { AuthCallbackRequest } = require('@solid/oidc-auth-manager').handlers
19+
import oidcOpExpress from 'oidc-op-express'
20+
21+
import oidcAuthManager from '@solid/oidc-auth-manager'
22+
const { AuthCallbackRequest } = oidcAuthManager.handlers
2123

2224
/**
2325
* Sets up OIDC authentication for the given app.
@@ -26,7 +28,7 @@ const { AuthCallbackRequest } = require('@solid/oidc-auth-manager').handlers
2628
* @param argv {Object} Config options hashmap
2729
*/
2830
export function initialize (app, argv) {
29-
const oidc = OidcManager.fromServerConfig(argv)
31+
const oidc = fromServerConfig(argv)
3032
app.locals.oidc = oidc
3133
oidc.initialize()
3234

@@ -120,7 +122,7 @@ export function middleware (oidc) {
120122
// router.post('/token', token.bind(provider))
121123
// router.get('/userinfo', userinfo.bind(provider))
122124
// router.get('/logout', logout.bind(provider))
123-
const oidcProviderApi = require('oidc-op-express')(oidc.provider)
125+
const oidcProviderApi = oidcOpExpress(oidc.provider)
124126
router.use('/', oidcProviderApi)
125127

126128
return router

lib/api/authn/webid-tls.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import webid from '../../webid/tls.mjs'
1+
import * as webid from '../../webid/tls/index.mjs'
22
import debug from '../../debug.mjs'
33
const debugAuth = debug.authentication
44

lib/api/index.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
export { default as authn } from './authn/index.mjs'
2-
export { default as accounts } from './accounts/user-accounts.mjs'
1+
import authn from './authn/index.mjs'
2+
import accounts from './accounts/user-accounts.mjs'
3+
4+
export { authn as authn, accounts as accounts }
5+
6+
// Provide a default export so callers can `import API from './lib/api/index.mjs'`
7+
export default { authn, accounts }

0 commit comments

Comments
 (0)