Skip to content

Commit 9b47c57

Browse files
authored
Merge pull request #225 from britive/develop
v2.4.0-rc.2
2 parents 8659f7a + 22793b2 commit 9b47c57

19 files changed

Lines changed: 237 additions & 87 deletions

‎.github/workflows/pypi-publish-on-push-on-new-release.yml‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,22 @@ permissions:
1111

1212
jobs:
1313
deploy:
14-
1514
runs-on: ubuntu-latest
1615

1716
steps:
18-
- uses: actions/checkout@v3
19-
- name: Set up Python
20-
uses: actions/setup-python@v3
21-
with:
22-
python-version: '3.9'
23-
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install build
27-
- name: Build package
28-
run: python -m build
29-
- name: Publish package
30-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
31-
with:
32-
user: __token__
33-
password: ${{ secrets.PYPI_API_TOKEN }}
17+
- uses: actions/checkout@v3
18+
- name: Set up Python
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: "3.11"
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install build
26+
- name: Build package
27+
run: python -m build
28+
- name: Publish package
29+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
30+
with:
31+
user: __token__
32+
password: ${{ secrets.PYPI_API_TOKEN }}

‎.github/workflows/pypi-test-publish-on-push-to-develop-branch.yml‎

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@ permissions:
1212

1313
jobs:
1414
deploy:
15-
1615
runs-on: ubuntu-latest
1716

1817
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python
21-
uses: actions/setup-python@v3
22-
with:
23-
python-version: '3.9'
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install build
28-
- name: Build package
29-
run: python -m build
30-
- name: Publish package
31-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
32-
with:
33-
user: __token__
34-
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
35-
repository_url: https://test.pypi.org/legacy/
18+
- uses: actions/checkout@v3
19+
- name: Set up Python
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: "3.11"
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install build
27+
- name: Build package
28+
run: python -m build
29+
- name: Publish package
30+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
31+
with:
32+
user: __token__
33+
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
34+
repository_url: https://test.pypi.org/legacy/

‎CHANGELOG.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Changelog
22

3+
## v2.4.0-rc.2 [2026-09-16]
4+
5+
__What's New:__
6+
7+
* Added `tokens [create|get|list|revoke]` command to manage temporary bearer tokens for the authenticated user.
8+
9+
__Enhancements:__
10+
11+
* None
12+
13+
__Bug Fixes:__
14+
15+
* None
16+
17+
__Dependencies:__
18+
19+
* Bumped the `britive` SDK minimum to `4.8.0b0`.
20+
* Dropped `python3.9` support, EOL 2025-10-31, was dropped by `britive` dependency in `v4.5.0`.
21+
* Updated github workflows python version to `python3.11`
22+
23+
__Other:__
24+
25+
* Python lint related changes.
26+
327
## v2.4.0-rc.1 [2026-06-08]
428

529
__What's New:__

‎docs/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Full Britive documentation is available here: [docs.britive.com](https://docs.br
66

77
## Requirements
88

9-
* Python 3.9 or higher
9+
* Python 3.10 or higher
1010
* Active Britive tenant (or nothing is really going to work)
1111

1212
## Installation

‎pyproject.toml‎

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=42",
4-
"wheel"
5-
]
2+
requires = ["setuptools>=42", "wheel"]
63
build-backend = "setuptools.build_meta"
74

85
[project]
96
name = "pybritive"
10-
authors = [{name = "Britive Inc.", email = "support@britive.com"}]
7+
authors = [{ name = "Britive Inc.", email = "support@britive.com" }]
118
description = "A pure Python CLI for Britive"
129
readme = "README.md"
1310
classifiers = [
1411
"License :: OSI Approved :: MIT License",
1512
"Operating System :: OS Independent",
1613
"Programming Language :: Python",
17-
"Programming Language :: Python :: 3.9",
1814
"Programming Language :: Python :: 3.10",
1915
"Programming Language :: Python :: 3.11",
2016
"Programming Language :: Python :: 3.12",
2117
"Programming Language :: Python :: 3.13",
18+
"Programming Language :: Python :: 3.14",
2219
"Topic :: Internet",
2320
"Topic :: Security",
2421
"Topic :: Utilities",
2522
]
26-
license = {file = "LICENSE"}
27-
requires-python = ">= 3.9"
23+
license = { file = "LICENSE" }
24+
requires-python = ">= 3.10"
2825
dependencies = [
29-
"britive>=4.6.0,<5.0",
26+
"britive>=4.8.0b0,<5.0",
3027
"click>=8.1.7",
3128
"colored>=2.2.5",
3229
"cryptography",
@@ -37,7 +34,7 @@ dependencies = [
3734
"PyYAML",
3835
"requests>=2.31.0",
3936
"tabulate",
40-
"toml"
37+
"toml",
4138
]
4239
dynamic = ["version"]
4340
keywords = ["britive", "cpam", "identity", "jit", "cli"]
@@ -59,10 +56,10 @@ Issues = "https://github.com/britive/python-cli/issues"
5956
Changelog = "https://github.com/britive/python-cli/blob/main/CHANGELOG.md"
6057

6158
[tool.setuptools]
62-
package-dir = {"" = "src"}
59+
package-dir = { "" = "src" }
6360

6461
[tool.setuptools.dynamic]
65-
version = {attr = "pybritive.__version__"}
62+
version = { attr = "pybritive.__version__" }
6663

6764
[tool.setuptools.packages.find]
6865
where = ["src"]
@@ -83,10 +80,10 @@ line-ending = "auto"
8380

8481
[tool.ruff.lint]
8582
select = [
86-
"E", # pycodestyle
87-
"F", # Pyflakes
88-
"I", # isort
89-
"PL", #pylint
83+
"E", # pycodestyle
84+
"F", # Pyflakes
85+
"I", # isort
86+
"PL", #pylint
9087
"SIM", # flake8-simplify
9188
]
9289

@@ -95,4 +92,4 @@ allow-magic-value-types = ["int", "str"]
9592
max-args = 18
9693
max-branches = 30
9794
max-returns = 8
98-
max-statements = 72
95+
max-statements = 72

‎requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
beautifulsoup4
22
boto3
3-
britive>=4.1.2,<5.0
3+
britive>=4.8.0b0,<5.0
44
certifi
55
charset-normalizer
66
click>=8.1.7

‎src/pybritive/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.4.0-rc.1'
1+
__version__ = '2.4.0-rc.2'

‎src/pybritive/britive_cli.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,29 @@ def user(self):
315315
output += f' (alias: {alias})'
316316
self.print(output, ignore_silent=True)
317317

318+
def create_temp_token(self, duration_seconds: Optional[int] = None):
319+
self.login()
320+
token = self.b.security.temp_tokens.create(duration_seconds=duration_seconds)
321+
output = [token] if self.output_format in ['csv', 'list'] else token
322+
self.print(output, ignore_silent=True)
323+
324+
def list_temp_tokens(self):
325+
self.login()
326+
tokens = self.b.security.temp_tokens.list()
327+
if not tokens and self.output_format == 'csv':
328+
return # There are no fields from which to build a CSV header.
329+
self.print(tokens, ignore_silent=True)
330+
331+
def get_temp_token(self, token_id: str):
332+
self.login()
333+
token = self.b.security.temp_tokens.get(token_id=token_id)
334+
output = [token] if self.output_format in ['csv', 'list'] else token
335+
self.print(output, ignore_silent=True)
336+
337+
def revoke_temp_token(self, token_id: str):
338+
self.login()
339+
self.b.security.temp_tokens.revoke(token_id=token_id)
340+
318341
def list_secrets(self, search_text: Optional[str] = None):
319342
self.login()
320343
self.print(self.b.my_secrets.list(search=search_text), ignore_silent=True)

‎src/pybritive/cli_interface.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from pybritive.commands.request import request as group_request
1717
from pybritive.commands.secret import secret as group_secret
1818
from pybritive.commands.ssh import ssh as group_ssh
19+
from pybritive.commands.tokens import tokens as group_tokens
1920
from pybritive.commands.user import user as command_user
2021
from pybritive.options.britive_options import britive_options
2122

@@ -55,6 +56,7 @@ def cli(version):
5556
cli.add_command(command_api)
5657
cli.add_command(group_ssh)
5758
cli.add_command(group_aws)
59+
cli.add_command(group_tokens)
5860

5961

6062
if __name__ == '__main__':

‎src/pybritive/commands/checkout.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'gcloud_key_file,verbose,extend,profile_type,tenant,token,passphrase,federation_provider'
1313
)
1414
@click_smart_profile_argument
15-
def checkout( # noqa: PLR0913
15+
def checkout( # noqa: PLR0913, PLR0917
1616
ctx,
1717
alias,
1818
blocktime,

0 commit comments

Comments
 (0)