Giter Site home page Giter Site logo

Access security about pvapy HOT 6 CLOSED

epics-base avatar epics-base commented on August 16, 2024
Access security

from pvapy.

Comments (6)

sveseli avatar sveseli commented on August 16, 2024 1

Access security needs to be enabled in the underlying PV Database code (see epics-base/pvDatabaseCPP#58). As soon as this is done, I will add relevant interfaces to PvaServer class (see https://github.com/epics-base/pvaPy/tree/access-security)

from pvapy.

thomasms avatar thomasms commented on August 16, 2024

I know this is currently being worked out with regard to pvDatabase, but I have a further question/comment on this.

Is it possible for information on the requester to be accessed in the callback? For example

import pvapy as pv

def mycb(x, req):
    # only permit write access from this machine
    if req.ipv4 != "X.X.X.X":
        # block write & throw exception
        # but how to block write?
        raise AccessControlException("You do not have access")

pv1 = pv.PvInt(4)
server = pv.PvaServer('mypv', pv1, mycb)

Completely ignoring the concept of the ACF but instead define access control via the callbacks.

Not sure if the callback is the best place to put this, since you cannot prevent the put there, I wondered if there are other potential mechanisms to do such things?

To simplify things let's ignore access control all together and let's imagine we have a PV that is read-only - always - regardless of the client. Then again, I would think the callback could be used here but it is not clear how to stop the write, since the code below still permits the put - any advice on how to handle this scenario?

import pvapy as pv

def mycb(x, req):
    raise ReadOnlyException("Write not permitted.")

readonlypv= pv.PvInt(4)
server = pv.PvaServer('readonlypv', readonlypv, mycb)

from pvapy.

sveseli avatar sveseli commented on August 16, 2024

In order to make this work without access security, we would need a "before write" record interface in the PV Database code. @mrkraimer, what are your thoughts on this?

from pvapy.

mrkraimer avatar mrkraimer commented on August 16, 2024

Note that ChannelProviderLocal has methods canWrite and canRead.
Does this help?

from pvapy.

sveseli avatar sveseli commented on August 16, 2024

Aren't those methods available in the ChannelLocal class, not in ChannelProviderLocal? It seems like there would have to be something like "onRead(requester)" and "onWrite(requester)" interfaces available in the PvRecord class (similar to the process() interface).

from pvapy.

sveseli avatar sveseli commented on August 16, 2024

Access security is now available (since release 4.0.0, see https://github.com/epics-base/pvaPy/blob/master/documentation/accessSecurity.md).

from pvapy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.