Browse Source

Task/harden endpoint of public access for portfolio sharing (#7205)

* Harden endpoint by restricting to public accesses

* Update changelog
pull/7181/head^2
Thomas Kaul 2 weeks ago
committed by GitHub
parent
commit
fc8c85c5e8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 5
      apps/api/src/app/endpoints/public/public.controller.ts

1
CHANGELOG.md

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Hardened the endpoint of the public access for portfolio sharing by restricting it to public accesses
- Improved the language localization by translating various tooltips across the application
- Upgraded `yahoo-finance2` from version `3.14.3` to `3.15.4`

5
apps/api/src/app/endpoints/public/public.controller.ts

@ -46,7 +46,10 @@ export class PublicController {
public async getPublicPortfolio(
@Param('accessId') accessId: string
): Promise<PublicPortfolioResponse> {
const access = await this.accessService.access({ id: accessId });
const access = await this.accessService.access({
granteeUserId: null,
id: accessId
});
if (!access) {
throw new HttpException(

Loading…
Cancel
Save