feat: Update authentication middleware (#6447)

* authentication middleware update

* disable customer authentication

* call correct feature flag method

* fix authentication middleware for store/customers

* fix integration tests and add middleware for admin customers

* update seeders

* customer groups fix

* add authentication middleware for all admin endpoints

* Feat(medusa, user): require authentication for invite accept (#6448)

* initial invite token validation for authentication invocation

* remove invite auth

* remove unused import

* cleanup tests

* refactor to auth instead of auth_user

* pr feedback

* update authenticatedRequest type

* update store authenticated endpoints

* update routes with type

* fix build

* fix build

* fix build

* use auth middleware for api-keys
This commit is contained in:
Philip Korsholm
2024-02-27 13:50:18 +08:00
committed by GitHub
parent 63aea44e06
commit 7bddb58542
94 changed files with 1177 additions and 509 deletions

View File

@@ -1,17 +1,18 @@
import { useApi } from "../../../environment-helpers/use-api"
import { initDb, useDb } from "../../../environment-helpers/use-db"
import {
createStep,
createWorkflow,
StepResponse,
WorkflowData,
} from "@medusajs/workflows-sdk"
import { initDb, useDb } from "../../../environment-helpers/use-db"
import { AxiosInstance } from "axios"
import adminSeeder from "../../../helpers/admin-seeder"
import { createAdminUser } from "../../helpers/create-admin-user"
import { getContainer } from "../../../environment-helpers/use-container"
import path from "path"
import { startBootstrapApp } from "../../../environment-helpers/bootstrap-app"
import { getContainer } from "../../../environment-helpers/use-container"
import adminSeeder from "../../../helpers/admin-seeder"
import { useApi } from "../../../environment-helpers/use-api"
export const workflowEngineTestSuite = (env, extraParams = {}) => {
const adminHeaders = {
@@ -31,7 +32,7 @@ export const workflowEngineTestSuite = (env, extraParams = {}) => {
shutdownServer = await startBootstrapApp({ cwd, env })
medusaContainer = getContainer()
await adminSeeder(dbConnection)
await createAdminUser(dbConnection, adminHeaders)
})
afterAll(async () => {