aws_authenticator


Nameaws_authenticator JSON
Version 2024.1.0.0 PyPI version JSON
download
home_pagehttps://gitlab.com/fer1035_python/modules/pypi-aws_authenticator
SummaryLogin to AWS using CLI named profiles, IAM access key credentials, or SSO.
upload_time2024-02-02 03:54:57
maintainer
docs_urlNone
authorAhmad Ferdaus Abd Razak
requires_python>=3.6,<4.0
licenseGPL-2.0-only
keywords aws login profile access key sso
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =====================
**aws-authenticator**
=====================

Overview
--------

Login to AWS using CLI named profiles, IAM access key credentials, or SSO.

Prerequisites
-------------

- *Python >= 3.6*
- *aws-ssooidc (https://pypi.org/project/aws-ssooidc/) >= 2021.1.1.1*
- *boto3 (https://pypi.org/project/boto3/) >= 1.17.78*

Conditional Arguments
---------------------

If authenticating with named profiles:

- AWSCLI profile name

If authenticating with IAM acccess key credentials:

- AWS access key id
- AWS secret access key

If authenticating with SSO:

- AWS account ID
- AWS SSO Permission Set (role) name
- AWS SSO login URL

Usage
-----

Installation:

.. code-block:: BASH

   pip3 install aws-authenticator
   # or
   python3 -m pip install aws-authenticator

In Python3 authenticating with named profiles:

.. code-block:: PYTHON

   import aws_authenticator

   auth = aws_authenticator.AWSAuthenticator(
      profile_name="<profile-name>",
   )
   session = auth.profile()
   client = session.client("<service-name>")

In Python3 authenticating with IAM access key credentials:

.. code-block:: PYTHON

   import aws_authenticator

   auth = aws_authenticator.AWSAuthenticator(
      access_key_id="<access-key-id>",
      secret_access_key="<secret-access-key>",
   )
   session = auth.iam()
   client = session.client("<service-name>")

In Python3 authenticating with SSO:

.. code-block:: PYTHON

   import aws_authenticator

   auth = aws_authenticator.AWSAuthenticator(
      sso_url="<sso-url>",
      sso_role_name="<sso-role-name>",
      sso_account_id="<sso-account-id>",
   )
   session = auth.sso()
   client = session.client("<service-name>")

Testing Examples
----------------

Testing SSO-based login in Python3:

.. code-block:: PYTHON

   import aws_authenticator

   auth = aws_authenticator.AWSAuthenticator(
      sso_url="<sso-url>",
      sso_role_name="<sso-role-name>",
      sso_account_id="<sso-account-id>",
   )
   session = auth.sso()
   client = session.client("sts")

   response = client.get_caller_identity()
   print(response)

Testing profile-based login as a script in BASH:

.. code-block:: BASH

   python [/path/to/]aws_authenticator \
   -m profile \
   -p <profile-name>

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/fer1035_python/modules/pypi-aws_authenticator",
    "name": "aws_authenticator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6,<4.0",
    "maintainer_email": "",
    "keywords": "AWS,login,profile,access key,SSO",
    "author": "Ahmad Ferdaus Abd Razak",
    "author_email": "ahmad.ferdaus.abd.razak@ni.com",
    "download_url": "https://files.pythonhosted.org/packages/27/74/b1d3e8f210038b8baa049cbbec3022b47bcc890fc3af8c2a4f8387e85f8d/aws_authenticator-2024.1.0.0.tar.gz",
    "platform": null,
    "description": "=====================\n**aws-authenticator**\n=====================\n\nOverview\n--------\n\nLogin to AWS using CLI named profiles, IAM access key credentials, or SSO.\n\nPrerequisites\n-------------\n\n- *Python >= 3.6*\n- *aws-ssooidc (https://pypi.org/project/aws-ssooidc/) >= 2021.1.1.1*\n- *boto3 (https://pypi.org/project/boto3/) >= 1.17.78*\n\nConditional Arguments\n---------------------\n\nIf authenticating with named profiles:\n\n- AWSCLI profile name\n\nIf authenticating with IAM acccess key credentials:\n\n- AWS access key id\n- AWS secret access key\n\nIf authenticating with SSO:\n\n- AWS account ID\n- AWS SSO Permission Set (role) name\n- AWS SSO login URL\n\nUsage\n-----\n\nInstallation:\n\n.. code-block:: BASH\n\n   pip3 install aws-authenticator\n   # or\n   python3 -m pip install aws-authenticator\n\nIn Python3 authenticating with named profiles:\n\n.. code-block:: PYTHON\n\n   import aws_authenticator\n\n   auth = aws_authenticator.AWSAuthenticator(\n      profile_name=\"<profile-name>\",\n   )\n   session = auth.profile()\n   client = session.client(\"<service-name>\")\n\nIn Python3 authenticating with IAM access key credentials:\n\n.. code-block:: PYTHON\n\n   import aws_authenticator\n\n   auth = aws_authenticator.AWSAuthenticator(\n      access_key_id=\"<access-key-id>\",\n      secret_access_key=\"<secret-access-key>\",\n   )\n   session = auth.iam()\n   client = session.client(\"<service-name>\")\n\nIn Python3 authenticating with SSO:\n\n.. code-block:: PYTHON\n\n   import aws_authenticator\n\n   auth = aws_authenticator.AWSAuthenticator(\n      sso_url=\"<sso-url>\",\n      sso_role_name=\"<sso-role-name>\",\n      sso_account_id=\"<sso-account-id>\",\n   )\n   session = auth.sso()\n   client = session.client(\"<service-name>\")\n\nTesting Examples\n----------------\n\nTesting SSO-based login in Python3:\n\n.. code-block:: PYTHON\n\n   import aws_authenticator\n\n   auth = aws_authenticator.AWSAuthenticator(\n      sso_url=\"<sso-url>\",\n      sso_role_name=\"<sso-role-name>\",\n      sso_account_id=\"<sso-account-id>\",\n   )\n   session = auth.sso()\n   client = session.client(\"sts\")\n\n   response = client.get_caller_identity()\n   print(response)\n\nTesting profile-based login as a script in BASH:\n\n.. code-block:: BASH\n\n   python [/path/to/]aws_authenticator \\\n   -m profile \\\n   -p <profile-name>\n",
    "bugtrack_url": null,
    "license": "GPL-2.0-only",
    "summary": "Login to AWS using CLI named profiles, IAM access key credentials, or SSO.",
    "version": "2024.1.0.0",
    "project_urls": {
        "Homepage": "https://gitlab.com/fer1035_python/modules/pypi-aws_authenticator",
        "Repository": "https://gitlab.com/fer1035_python/modules/pypi-aws_authenticator"
    },
    "split_keywords": [
        "aws",
        "login",
        "profile",
        "access key",
        "sso"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9fe20df9b455b9ca5fe83e77deb61a631fb3329dec5abd702d44e9170e34521d",
                "md5": "921f7d813328746efb3a99199a7bd4a4",
                "sha256": "171c9b2ae8b22f77cd48570cccaa9baefbc9e8e0d224a0a6fa24fb77a371b7f3"
            },
            "downloads": -1,
            "filename": "aws_authenticator-2024.1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "921f7d813328746efb3a99199a7bd4a4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<4.0",
            "size": 3471,
            "upload_time": "2024-02-02T03:54:55",
            "upload_time_iso_8601": "2024-02-02T03:54:55.651480Z",
            "url": "https://files.pythonhosted.org/packages/9f/e2/0df9b455b9ca5fe83e77deb61a631fb3329dec5abd702d44e9170e34521d/aws_authenticator-2024.1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2774b1d3e8f210038b8baa049cbbec3022b47bcc890fc3af8c2a4f8387e85f8d",
                "md5": "5912e1403a97bb449c58917cc378843d",
                "sha256": "f6e7038d7d5eb4e9c1894983b7e4bc903dec3876292dd2cc2a1d257d706589d8"
            },
            "downloads": -1,
            "filename": "aws_authenticator-2024.1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5912e1403a97bb449c58917cc378843d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6,<4.0",
            "size": 2714,
            "upload_time": "2024-02-02T03:54:57",
            "upload_time_iso_8601": "2024-02-02T03:54:57.257172Z",
            "url": "https://files.pythonhosted.org/packages/27/74/b1d3e8f210038b8baa049cbbec3022b47bcc890fc3af8c2a4f8387e85f8d/aws_authenticator-2024.1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-02 03:54:57",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "fer1035_python",
    "gitlab_project": "modules",
    "lcname": "aws_authenticator"
}
        
Elapsed time: 0.17819s