0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/api/canary
Fabien 'egg' O'Carroll c19d282a51
Ensured Admin API members resource only returns known fields (#12240)
refs #12055

As part of the work in TryGhost/Members#206 we load the stripeCustomers relation on the member model, and we do not want this to be part of the API response. The changes here include a refactor but the main thing is that the serialized object is explicit and does not include unexpected or unknown fields.

* Moved mapMember out of mapper file

This cleans up the serializer a bit by keeping it's functionality all in
one place, rather than a shared mapper file

* Refactored members controller to return models

Previously the controller was calling toJSON, which is serialization,
this updates the controller to only deal with models, leaving all of the
serialization to the serializer!

* Refactored members serializer

This adds typings to all of the methods/functions in the serializer, as
well as making the serializating explicit, rather than returning the
result of toJSON, we explicitly set the properties we expect to be on
the output object. This protects us against accidental API changes in
the future.
2020-09-30 10:22:22 +01:00
..
utils Ensured Admin API members resource only returns known fields (#12240) 2020-09-30 10:22:22 +01:00
actions.js
authentication.js
authors-public.js
config.js Added new portal config flag 2020-09-17 19:40:34 +05:30
db.js
email-preview.js Refactor mega service to use stored email content and batch/recipient records 2020-09-29 17:17:54 +01:00
email.js
identities.js
images.js
index.js
integrations.js
invites.js Extracted core/server/lib/security to @tryghost/security package 2020-08-11 14:06:50 +01:00
labels.js
mail.js
members.js Ensured Admin API members resource only returns known fields (#12240) 2020-09-30 10:22:22 +01:00
memberSigninUrls.js Updated getMagicLink call to handle Promise return 2020-09-18 10:49:18 +01:00
membersStripeConnect.js Supported test mode in members_stripe_connect API 2020-06-10 14:06:57 +02:00
notifications.js
oembed.js 🐛 Fixed embed/bookmark retrieval for sites that require cookies during redirects 2020-06-17 10:03:36 +01:00
pages-public.js
pages.js Allowed ?formats param in Admin API post+page create/edit requests 2020-06-18 13:59:01 +01:00
posts-public.js
posts.js Changed member limit to be DRY & use raw query 2020-07-26 20:49:30 +01:00
preview.js
redirects.js
roles.js
schedules.js
session.js
settings-public.js
settings.js 🐛 Fixed email verification mails not sent 2020-09-24 23:39:25 +05:30
site.js Renamed settings key brand.primaryColor to accent_color 2020-06-24 14:18:13 +12:00
slack.js
slugs.js
tags-public.js
tags.js
themes.js
users.js
webhooks.js Added check for parent integration_id when creating a webhook 2020-09-24 15:09:51 +12:00