Commit Graph

10 Commits

Author SHA1 Message Date
Stevche Radevski
8a070d5d85 Revamp the authentication setup (#7419)
* feat: Add email pass authentication provider package

* feat: Revamp auth module and remove concept of scope

* feat: Revamp the auth module to be more standardized in how providers are loaded

* feat: Switch from scope to actor type for authentication

* feat: Add support for per-actor auth methods

* feat: Add emailpass auth provider by default

* fix: Add back app_metadata in auth module
2024-05-23 20:56:40 +02:00
Stevche Radevski
f03a822253 feat: Add support for search to all endpoints (#7149)
* feat: Add search capability to api keys

* feat: Add support for searching to currency and customer endpoints

* fix: Clean up product search filters

* feat: Add search support to regions

* feat: Add search support to sales channels

* feat: Add search support to store module

* feat: Add search support to user module

* fix: Clean up inventory search

* feat: Add search support for payments

* fix: Add searchable attributes to stock location models

* feat: Add search support to tax

* feat: Add search support to promotions

* feat: Add search support for pricing, filtering cleanup

* fix: Further cleanups around search
2024-04-25 17:36:59 +02:00
Oli Juhl
7bc7adeeb4 feat: Create user account (#6819) 2024-03-26 10:07:38 +01:00
Kasper Fabricius Kristensen
d68089b2aa fix(medusa): Implement listAndCount for UserService and update list endpoint (#6190) 2024-01-24 10:41:35 +01:00
David Preininger
2caff2efc7 feat(medusa): Authentication overhaul (#4064)
* implemented bearer auth

* changed naming strat

* changed session auth to not use jwt

* typo

* changed auth header prefix for admin api token auth

* fixed supporting functions to work with new session type

* removed database calls for bearer auth improving performance

* removed unused deps

* changed auth in tests

* added integration tests

* Accepted suggested change

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>

* Typo

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

* more typos

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

* proper formatting

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

* removed endregion

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

* removed startregion

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

* fixed admin JWT integration test

* added more fixes to integration tests

* Update OAS

* Create fluffy-donkeys-hope.md

* created API reference for new auth

* implemented getToken in medusa-js

* Apply suggestions from code review

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>

* Apply suggestions from code review

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>

* deleted files which should be autogenerated

* Update fluffy-donkeys-hope.md

* JSDoc update

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* added missing route exports

* implemented runtime domain safety in jwt token manager

* fixed jwt manager

* lint get-token files

* Update fluffy-donkeys-hope.md

* Revert "deleted files which should be autogenerated"

This reverts commit cd5e86623b822e6a6ac37322b952143ccc493df9.

* Revert "Apply suggestions from code review"

This reverts commit f02f07ce58fd9fcc2dfc80cadbb9df2665108d65.

* Revert "created API reference for new auth"

This reverts commit c9eafbb36453f5cf8047c79e94f470cb2d023c7d.

* renamed header for sending api access tokens

* medusa-js - changed apiKey header

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: olivermrbl <oliver@mrbltech.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2023-09-25 13:57:44 -04:00
Adrien de Peretti
4d326fbbdf chore: Move factories and helpers to a better place (#4551)
* chore: Move factories and helpers to a better place

* align factory product variant

* fix factory cart

* add simple store fac

* fix tests

* fix tests

* fix

* fix cart seeder
2023-07-20 13:16:04 +02:00
Philip Korsholm
aed7805c0e fix(medusa): Error messages for reset tokens (#3514)
* initial

* reset password token handling

* Create .changeset/old-planes-cross.md

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-19 10:52:10 +01:00
Adrien de Peretti
42d9c7222b feat(medusa): Performance improvements of Carts domain (#2648)
**What**

I have created a new method on the cart service which is `addLineItems`, allowing a user to add one or multiple items in an optimized way. Also updated the `generate` method from the line item service which now also accept a object data or a collection of data which. Various places have been optimized and cache support has been added to the price selection strategy.

The overall optimization allows to reach another 9000% improvement in the response time as a median (Creating a cart with 6 items):

|   | Min (ms)  | Median (ms)  | Max (ms)  | Median Improvement (%)
|---|:-:|---|---|---|
| Before optimisation  | 1200  | 9999 | 12698  |  N/A
| After optimisation | 63  | 252  | 500  | 39x
| After re optimisation | 56 | 82  | 399  | 121x
| After including addressed feedback | 65 | 202  | 495  | 49x

FIXES CORE-722
2022-12-07 14:39:12 +00:00
Kasper Fabricius Kristensen
4de4f20b46 feat(medusa): add analytics config (#2442)
**What**
- Adds new entity AnalyticsConfig
- Adds new service AnalyticsConfigService
- Adds new repository AnalyticsConfigRepository
- Adds new endpoints to get, create, update, and delete analytics configs

**Why**
As we begin gathering usage insights to help us improve Medusa, we want to give each individual users the ability to control what data they share with us, or not share any data with us at all. The AnalyticsConfig holds information that is used to check if the user wishes for their data to be anonymized or if they have opted out of sharing usage data.

The entire feature can be disabled on a store level by setting the feature flag `MEDUSA_FF_ANALYTICS=false` in their environment variables, the feature is enabled by default. 

**Testing**
Adds integration test for each of the new endpoints

Resolves CORE-656, CORE-655, CORE-654

Also resolves CORE-574
2022-10-21 13:04:46 +00:00
Philip Korsholm
d1b8f4b50b Feat: Extend user api (#460)
* api routes for user management

* add invites and roles to db

* services

* invite repo

* include user in accepting invitation

* include user role in create user

* api password reset

* delete invite

* include email in reset password token

* added metadata as dbawarecolumn

* added events for invite handling and delete functionality

* added invite model to exports

* add default value member and allow null roles

* conditional inclusion of invites in "list-users"

* integration tests for users

* helpers for user testing

* add unauthenticated routes to users

* simplifying create invite

* create users with first and last name, and dev role

* reset password endpoint

* removed token from response

* update user with firstname, lastname and role

* create invite refactor

* test password reset without email in body

* removed redundant router variable

* cleanup

* unit tests

* adjustments

* service tests

* adjustments according to api changes

* fix cart test

* cloned now works

* change name to verified token for the verified token

* add a space

* db aware columns

* fix: timestampz dbaware

* more testing

* add list-invites endpoint

* reset-password error handling

* pr issues adjusted

* fixed test

* add optional to link templates

* move invites to a new endpoint

* migrate invites to own testsuite

* adjust snapshots

* email constraint for invite

* fix integration tests

* addressing pr feedback

* unit tests for extended user api

* linting

* fix integration tests

* fix unit tests

* fix: Addresses breaking change from class-transformer

* fix orders testing

* merge "create-claim" js and ts files

* add out commented tests

* update typescript endpoints to reflect changes made for user management

* converted invites to typescript

* add exports from api endpoints

* remove old js files used for reference

* integration test

* import reflect metadata

* invite service conversion to ts

* removed unused import

* update invite service to match styleguide

* add "expires_at" and "token" to invite table

* update invite service to save tokens and validate expires_at

* fix failing tests

* fix tests after adding token and expires_at to invite

* add expiration to create

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-12-08 10:15:22 +01:00