فهرست منبع

Update README.md

Daniel Gruno 5 سال پیش
والد
کامیت
99823e1044
1فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 12 0
      README.md

+ 12 - 0
README.md

@@ -41,3 +41,15 @@ def main():
     pubsub = asfpy.pubsub.Listener('http://localhost:2069')
     pubsub.attach(process_event) # poll forever
 ~~~
+
+## Access-Control-List and private events
+PyPubSub supports private events that only authenticated clients can receive.
+
+### Pushing a private event
+To mark an event as private, simply prepend `private` as the first topic when you push the event:
+`curl -XPUT -d '{"private_text": "Squeamish Ossifrage"}' http://localhost/private/topics/here`
+
+### Retreiving private events
+Clients ACL is defined in `pypubsub_acl.yaml`. See the example ACL configuration for an example.
+Access is, again, defined with "highest common denominator" in mind, meaning access to topics is granted 
+to the specific topic group specified in the yaml and its sub-groups. Thus, if you grant access to `internal` and `foo` in one ACL segment, events pushed to `private/internal/foo` would be seen by that client, whereas pushes to `private/internal/bar` would not.