Skip to content

How do I disable relations / remove them from the Explorer? #477

Closed

Description

@STRML

Since updating, I am now seeing the

/user/{id}/accessTokens/{fk} routes in the API Explorer. I don't want to expose these. How do I prevent them from being publicly invoked and remove them from the Explorer?

Activity

  1. STRML commented on Aug 21, 2014

    @STRML
    MemberAuthor

    I have a utility class that tries to disable the shared property on every single function in a model, except for those in a whitelist. IMO this should be built-in functionality, on a real webapp you simply cannot expose every single REST function to the public, regardless of ACLs, as they'll still show up in the explorer (and the explorer is a great way to expose documentation).

    My tool worked in 1.x, fails in 2.x. It simplify iterates through all properties of the model and looks for the shared property, and sets it to false is present, and the function name is not in the whitelist.

    I've since updated it for 2.x by concatenating the methods from {Model}.sharedClass.methods(), but it still fails on relations.

    The issue appears to be this line in strong-remoting which creates a new SharedMethod from the internal resolvers array every time methods() is called. No options are passed and it is not possible to set shared.

  2. raymondfeng commented on Aug 21, 2014

    @raymondfeng
    Member

    @ritch Can you help?

  3. STRML commented on Aug 26, 2014

    @STRML
    MemberAuthor

    I've created a corresponding issue in strong-remoting. I believe it may be a large change, otherwise I would submit a PR (you know I like to do that). This is the last thing preventing me from moving my app to Loopback 2.0, so please let me know how I can help.

  4. superkhau commented on Feb 4, 2016

    @superkhau
    Contributor

    This issue appears to be resolved at strongloop/strong-remoting#94. Closing. @STRML Please open a new issue if you are still having problems with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions