[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #5454 [Stem]: ExitPolicy Class for stem
#5454: ExitPolicy Class for stem
-------------------------+--------------------------------------------------
Reporter: gsathya | Owner: atagar
Type: enhancement | Status: needs_information
Priority: normal | Milestone:
Component: Stem | Version:
Keywords: | Parent:
Points: | Actualpoints:
-------------------------+--------------------------------------------------
Changes (by gsathya):
* status: needs_revision => needs_information
Comment:
https://gitweb.torproject.org/user/gsathya/stem.git/blobdiff/c6b692c42ebe09bc0f522cd242d3149abe30c460..cf5978f221d85a54511be5dc55272eb74794ed97:/stem/exit_policy.py
WIP. I don't think it's time to review it now. I just want a sanity check
on the logic/API.
Still need to add exceptions, docstrings. But I have the core
functionality/logic finished. Still looks hackish - I'll do some more
polishing soonish.
I went with another class for microdescriptors rather than creating a new
ExitPolicyLine and then subclassing that. The mircodescriptor exit
policies don't care about IP's so this makes more sense.
Right now, the API looks like this
{{{
# just get the exitpolicy from the micro-descriptor and parse it
> exit_policy = new MircodescriptorExitPolicy()
> exit_policy.add("accept 80,443")
> print exit_policy
accept 80,443
# ask the user to add the exit policy rules and strip out ip address
> exit_policy = new MircodescriptorExitPolicy()
> exit_policy.add("accept *:80")
> exit_policy.add("accept 443")
> exit_policy.add("reject *:*")
> print exit_policy
accept 80,443
}}}
Thanks!
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/5454#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs