403Webshell
Server IP : 217.160.0.64  /  Your IP : 216.73.216.58
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67269618 ( 67269618)
PHP Version : 8.4.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/kunden/usr/lib/python3/dist-packages/breezy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/kunden/usr/lib/python3/dist-packages/breezy/__pycache__/url_policy_open.cpython-313.pyc
�

p��gO/��p�SrSSKrSSKJrJrJr SSKJr SSKJ	r	 SSK
JrJr "SS	\R5r"S
S\R5r"SS
\R5r"SS5r"SS\5r"SS\5r"SS\5r"SS\5r"SS5rSr\R15 g)z+Branch opening with URL-based restrictions.�N�)�errors�trace�urlutils)�Branch)�ControlDirFormat)�do_catching_redirections�
get_transportc��\rSrSrSrSrg)�BadUrl�z.Tried to access a branch from bad URL %(url)s.�N��__name__�
__module__�__qualname__�__firstlineno__�_fmt�__static_attributes__r��8/usr/lib/python3/dist-packages/breezy/url_policy_open.pyrrs��;�Drrc��\rSrSrSrSrg)�BranchReferenceForbidden�zRTrying to mirror a branch reference and the branch type does not allow references.rNrrrrrrs��	%�	rrc��\rSrSrSrSrSrg)�BranchLoopError�&z�Encountered a branch cycle.

A URL may point to a branch reference or it may point to a stacked branch.
In either case, it's possible for there to be a cycle in these references,
and this exception is raised when we detect such a cycle.
zEncountered a branch cyclerN)rrrr�__doc__rrrrrrr&s���(�Drrc�*�\rSrSrSrSrSrSrSrg)�BranchOpenPolicy�1z�Policy on how to open branches.

In particular, a policy determines which branches are okay to open by
checking their URLs and deciding whether or not to follow branch
references.
c�,�[UR5e)z�Whether we traverse references when mirroring.

Subclasses must override this method.

If we encounter a branch reference and this returns false, an error is
raised.

:returns: A boolean to indicate whether to follow a branch reference.
)�NotImplementedError�should_follow_references��selfs rr$�)BranchOpenPolicy.should_follow_references9s��"�$�"?�"?�@�@rc�,�[UR5e)a|Validate, maybe modify, 'url' to be used as a stacked-on location.

:param branch:  The branch that is being opened.
:param url: The URL that the branch provides for its stacked-on
    location.
:return: (new_url, check) where 'new_url' is the URL of the branch to
    actually open and 'check' is true if 'new_url' needs to be
    validated by check_and_follow_branch_reference.
)r#�transform_fallback_location�r&�branch�urls   rr)�,BranchOpenPolicy.transform_fallback_locationEs��"�$�"B�"B�C�Crc�,�[UR5e)z�Check a URL.

Subclasses must override this method.

:param url: The source URL to check.
:raise BadUrl: subclasses are expected to raise this or a subclass
    when it finds a URL it deems to be unacceptable.
)r#�
check_one_url�r&r,s  rr/�BranchOpenPolicy.check_one_urlQs��"�$�"4�"4�5�5rrN)	rrrrrr$r)r/rrrrr r 1s���
A�
D�	6rr c�4�\rSrSrSrS	SjrSrSrSrSr	g)
�_BlacklistPolicy�]z�Branch policy that forbids certain URLs.

This doesn't cope with various alternative spellings of URLs,
with e.g. url encoding. It's mostly useful for tests.
Nc�6�Uc
[5nX lXlg�N)�set�	_bad_urls�_should_follow_references)r&r$�bad_urlss   r�__init__�_BlacklistPolicy.__init__ds�����u�H�!��)A�&rc��UR$r6�r9r%s rr$�)_BlacklistPolicy.should_follow_referencesj����-�-�-rc�8�XR;a[U5egr6)r8rr0s  rr/�_BlacklistPolicy.check_one_urlms���.�.� ���+��!rc�H�[R"URU5S4$)z�See `BranchOpenPolicy.transform_fallback_location`.

This class is not used for testing our smarter stacking features so we
just do the simplest thing: return the URL that would be used anyway
and don't check it.
F�r�join�baser*s   rr)�,_BlacklistPolicy.transform_fallback_locationqs���}�}�V�[�[�#�.��5�5r)r8r9r6�
rrrrrr;r$r/r)rrrrr3r3]s���B�.��6rr3c�,^�\rSrSrSrU4SjrSrU=r$)�AcceptAnythingPolicy�{z(Accept anything, to make testing easier.c�6>�[TU]S[55 g�NT)�superr;r7)r&�	__class__s �rr;�AcceptAnythingPolicy.__init__~s���
����s�u�%rr)rrrrrr;r�
__classcell__)rOs@rrJrJ{s���2�&�&rrJc�4�\rSrSrSrS	SjrSrSrSrSr	g)
�WhitelistPolicy�z,Branch policy that only allows certain URLs.Nc�p�Uc/nUVs1sHoDRS5iM snUlX0lgs snf�N�/)�rstrip�allowed_urls�check)r&r$rYrZr,s     rr;�WhitelistPolicy.__init__�s5�����L�8D�E���Z�Z��_��E����
��Fs�3c��UR$r6r>r%s rr$�(WhitelistPolicy.should_follow_references�r@rc�X�URS5UR;a[U5egrV)rXrYrr0s  rr/�WhitelistPolicy.check_one_url�s'���:�:�c�?�$�"3�"3�3���+��4rc�\�[R"URU5UR4$)zSee `BranchOpenPolicy.transform_fallback_location`.

Here we return the URL that would be used anyway and optionally check
it.
)rrErFrZr*s   rr)�+WhitelistPolicy.transform_fallback_location�s"���}�}�V�[�[�#�.��
�
�:�:r)rYrZ)NFrHrrrrSrS�s��6��.��;rrSc�0�\rSrSrSrSrSrSrSrSr	g)	�SingleSchemePolicy�z=Branch open policy that rejects URLs not on the given scheme.c��Xlgr6��allowed_scheme)r&rgs  rr;�SingleSchemePolicy.__init__�s��,�rc��grMrr%s rr$�+SingleSchemePolicy.should_follow_references�s��rc�H�[R"URU5S4$rMrDr*s   rr)�.SingleSchemePolicy.transform_fallback_location�s���}�}�V�[�[�#�.��4�4rc��[RR[U55RUR
:wa[
U5eg)z!Check that `url` is okay to open.N)r�URL�from_string�str�schemergrr0s  rr/� SingleSchemePolicy.check_one_url�s9���<�<�#�#�C��H�-�4�4��8K�8K�K���+��LrrfN)
rrrrrr;r$r)r/rrrrrcrc�s��G�-��5�rrcc��\rSrSrSr\R"5rS
Sjr\	S5r
Sr\	S5rSr
S	rS
rSSjrSrg)�BranchOpener�aBranch opener which uses a URL policy.

All locations that are opened (stacked-on branches, references) are
checked against a policy object.

The policy object is expected to have the following methods:
* check_one_url
* should_follow_references
* transform_fallback_location
Nc�j�Xl[5UlUc[R"5nX lg)z�Create a new BranchOpener.

:param policy: The opener policy to use.
:param probers: Optional list of probers to allow.
    Defaults to local and remote bzr probers.
N)�policyr7�
_seen_urlsr�all_probers�probers)r&rwrzs   rr;�BranchOpener.__init__�s*�����%����?�&�2�2�4�G��rc�Z�[RRSURS5 g)a�Install the ``transform_fallback_location`` hook.

This is done at module import time, but transform_fallback_locationHook
doesn't do anything unless the `_active_openers` threading.Local
object has a 'opener' attribute in this thread.

This is in a module-level function rather than performed at module
level so that it can be called in setUp for testing `BranchOpener`
as breezy.tests.TestCase.setUp clears hooks.
r)z,BranchOpener.transform_fallback_locationHookN)r�hooks�install_named_hook�transform_fallback_locationHook)�clss r�install_hook�BranchOpener.install_hook�s%��	���'�'�)��/�/�:�	
rc�*�XR;a
[5eURRU5 URR	U5 URU5nUcU$UnURR
5(d[U5eM�)a�Check URL (and possibly the referenced URL).

This method checks that `url` passes the policy's `check_one_url`
method, and if `url` refers to a branch reference, it checks whether
references are allowed and whether the reference's URL passes muster
also -- recursively, until a real branch is found.

:param url: URL to check
:raise BranchLoopError: If the branch references form a loop.
:raise BranchReferenceForbidden: If this opener forbids branch
    references.
)rxr�addrwr/�follow_referencer$r)r&r,�next_urls   r�!check_and_follow_branch_reference�.BranchOpener.check_and_follow_branch_reference�s�����o�o�%�%�'�'��O�O����$��K�K�%�%�c�*��,�,�S�1�H����
��C��;�;�7�7�9�9�.�s�3�3�rc���URRnURR	X5upEU(aURU5$U$![a Us$f=f)z�Installed as the 'transform_fallback_location' Branch hook.

This method calls `transform_fallback_location` on the policy object
and either returns the url it provides or passes it back to
check_and_follow_branch_reference.
)�_threading_data�opener�AttributeErrorrwr)r�)r�r+r,r��new_urlrZs      rr�,BranchOpener.transform_fallback_locationHook�s_��	��(�(�/�/�F� ���B�B�6�O�����;�;�G�D�D��N��
�	��J�	�s�A�A�Ac��UR[RS;a[S5eXRlU"U0UD6UR?[
5Ul$!UR?[
5Ulf=f)Nr)zhook not installed)rrr}�AssertionErrorr�r�r7rx)r&�callable�args�kws    r�3run_with_transform_fallback_location_hook_installed�@BranchOpener.run_with_transform_fallback_location_hook_installeds}��
�0�0��<�<� =�>�
?�!�!5�6�6�&*���#�	$��T�(�R�(��$�$�+�"�e�D�O���$�$�+�"�e�D�O�s�A!�!A>c�p^�U4SjnU4Sjn[U5n[X4U5upEURU5$)zpSimple BzrDir.open clone that only uses specific probers.

:param url: URL to open
:return: ControlDir instance
c�R>�TRRUR5 URURUR5nUc [
R"UR5e[R"SURURUR5 U$)Nz%s is%s redirected to %s)rwr/�target�_redirected_to�sourcer�NotBranchErrorr�noterF�permanently)�	transport�e�redirection_notice�redirected_transportr&s    �r�
redirected�*BranchOpener._open_dir.<locals>.redirecteds}����K�K�%�%�a�h�h�/�#,�#;�#;�A�H�H�a�h�h�#O� �#�+��+�+�A�H�H�5�5��J�J�*�����
�
�$�)�)�	
�(�'rc��>�[R"UR5nTRHnU"5nXR	U54s $ Ue![Ra
nUnSnAM?SnAff=fr6)rr�rFrz�probe_transport)r��
last_error�
prober_kls�proberr�r&s     �r�find_format�+BranchOpener._open_dir.<locals>.find_format*sj����.�.�y�~�~�>�J�"�l�l�
�#���#�$�&<�&<�Y�&G�G�G�+�!� ���,�,�#�!"�J��#�s�A�A2�%A-�-A2)r
r	�open)r&r,r�r�r��formats`     r�	_open_dir�BranchOpener._open_dirs7���	(�		!�"�#�&�	�4�[�Z�X��	��{�{�9�%�%rc�D�URU5nUR5$)z{Get the branch-reference value at the specified url.

This exists as a separate method only to be overriden in unit tests.
)r��get_branch_reference)r&r,�
controldirs   rr��BranchOpener.follow_reference9s!��
�^�^�C�(�
��.�.�0�0rc�^�[U[5(d[eTRU5nU4SjnTR	X1U5$)z�Open the Bazaar branch at url, first checking it.

What is acceptable means is defined by the policy's `follow_reference`
and `check_one_url` methods.
c�D>�TRU5nURUS9$)N)�ignore_fallbacks)r��open_branch)r,r��dirr&s   �rr��&BranchOpener.open.<locals>.open_branchLs#����.�.��%�C��?�?�4D�?�E�Er)�
isinstancerp�	TypeErrorr�r�)r&r,r�r�s`   rr��BranchOpener.openAsH����#�s�#�#��O��4�4�S�9��	F��G�G��.�
�	
r)rxrwrzr6)F)rrrrr�	threading�localr�r;�classmethodr�r�rr�r�r�r�rrrrrtrt�s\��	� �o�o�'�O���
��
�"4�2����"$�"!&�F1�
rrtc�H�[[U55RU5$)z�Open the branch at `url`, only accessing URLs on `allowed_scheme`.

:raises BadUrl: An attempt was made to open a URL that was not on
    `allowed_scheme`.
)rtrcr�)rgr,s  r�open_only_schemer�Us ���*�>�:�;�@�@��E�Er)rr��rrrr+rr�rr�r	r
�BzrErrorrrrr r3rJrSrcrtr�r�rrr�<module>r�s���"2��%�%��(�>�<�V�_�_�<��v����(�f�o�o�(�)6�)6�X6�'�6�<&�+�&�;�&�;�2�)��$e
�e
�PF�
���r

Youez - 2016 - github.com/yon3zu
LinuXploit