Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

auth v4 - is publicly accessible entity.get now required? #1445

Copy link
Copy link
@jnardone

Description

@jnardone
Issue body actions

Steps to reproduce

One of our services has a global disallow hook on the users service. This has worked fine in the past - we allow other services to call it, but nothing external should need to directly interact with the users service.

In v4, this gets an error because of a disallowed GET:

'Provider 'rest' can not call 'get'. (disallow)' stack='MethodNotAllowed: Provider 'rest' can not call 'get'. (disallow)

Looking at the jwt.ts code, I see:

    const result = await entityService.get(id, omit(params, 'provider'));

    if (!params.provider) {
      return result;
    }

    return entityService.get(id, { ...params, [entity]: result });  // <-- ??

Why does this code now pass the params to the (last) get call if a provider is present on the authentication call? This is somewhat antithetical to the whole idea of an auth service - if I'm authenticated the service is supposed to return a (filtered) user context back to the caller. (It also seems inefficient to be calling this twice for every external authentication)

As noted in the final comments on the PR that added this: #1320

Why isn't the entityService.get just calling with NO params to get the user details?

Expected behavior

I should not have to have a publicly available users GET for authentication to succeed

Actual behavior

Request fails :(

System configuration

4.0.0-pre.4 for all components
node 10.16
macos mojave

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.