Skip to content

Can't overwrite policy? #398

Open
Open
@cgrimm013

Description

@cgrimm013

While debugging subscriptions, I found that I cannot overwrite an existing policy for a pico without explicitly deleting the policy. Even though our most recent subscription code changes pass all the tests, somehow policies are not included in the tests, which I discovered was breaking the code (I didn't alter the wellknown policy to include some event name changes). When I tried reregistering and reinstalling the subscription ruleset, the updated policy does not get created on an already existing pico. Take a look at this:

uploads/85bec3ca-7437-4a2c-9837-7c9bcd68d2ef/Screen Shot 2018-05-21 at 11.08.07 AM.png

This is on the root pico. Essentially, calling engine:newPolicy does not overwrite an existing policy, so the wellknown policy stays the same and doesn't get my new changes. Is this the desired functionality? It registers a new policy per pico under the name, but there is no way to change it save for explicitly calling engine:removePolicy. Maybe we could add an engine:updatePolicy action? How do we restrict developers so they can only update their own policies?

One security hole with this current problem: a ruleset could create a new policy called wellknown that allows every event. Then when subscriptions is installed, it will use the falsified policy instead of its intended one.. Maybe we could have system policies reserved so no one else can make one with the same name and mess something up? (the terminal could log an error for trying to register a policy with a system policy name)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions