HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/github.cpython-310.pyc
o

�N�g�@s2dZddlZddlZddlZe�e�Zdd�ZdS)z
Connection library for GitHub
�Nc	Cs�t|t�s	ddiSi}|D]Y}g}t|t�r$tt|����}||}|}d|�d�}tjjj	|dddd�}tjj
�|d	�}i||<|D]!}|r[t|d
�|vrZ|d|||d
<qD|d|||d
<qDq
|S)a4
    Retrieve a set of public keys from GitHub for the specified list of users.
    Expects input in list format. Optionally, a value in the list may be a dict
    whose value is a list of key IDs to be returned. If this is not done, then
    all keys will be returned.

    Some example data structures that coupld be passed in would look like:

    .. code_block:: yaml

        ['user1', 'user2', 'user3']

        [
            'user1': [
                '12345',
                '67890',
            ],
            'user2',
            'user3',
        ]
    �ErrorzA list of users is expectedzhttps://api.github.com/users/z/keysZGETFT)�decode�textr�id�key)
�
isinstance�list�dict�next�iter�keys�salt�utils�http�query�json�loads�str)	Zusers�ret�userZkey_idsZtmp_user�url�resultrr�r�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/github.py�get_user_pubkeys
s4

���r)	�__doc__�loggingZsalt.utils.httpr
Zsalt.utils.json�	getLogger�__name__�logrrrrr�<module>s