Skip to content

Commit

Permalink
Made audience optional in the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
dusktreader committed Oct 11, 2024
1 parent 9d85637 commit 94cf408
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

## v2.0.3 - 2024-10-10

- Made audience optional in cli

## v2.0.2 - 2024-10-05

- Added support for pytest 8

## v2.0.1 - 2024-05-29

- Restored optional TokenPayload fields.
Expand Down
3 changes: 1 addition & 2 deletions armasec_cli/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,14 @@ def refresh_access_token(ctx: CliContext, token_set: TokenSet):
If refresh fails, notify the user that they need to log in again.
"""
print("MAKE THIS FUCKING THING USE THE BASE URL")
url = "/protocol/openid-connect/token"
logger.debug(f"Requesting refreshed access token from {url}")

refreshed_token_set: TokenSet = cast(
TokenSet,
make_request(
ctx.client,
"/protocol/openid-connect/token",
url,
"POST",
abort_message="The auth token could not be refreshed. Please try logging in again.",
abort_subject="EXPIRED ACCESS TOKEN",
Expand Down
3 changes: 2 additions & 1 deletion armasec_cli/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
from functools import wraps
from pathlib import Path
from typing import Optional

import snick
import typer
Expand All @@ -21,7 +22,7 @@ class OidcProvider(AutoNameEnum):

class Settings(BaseModel):
oidc_domain: str
oidc_audience: str
oidc_audience: Optional[str] = None
oidc_client_id: str
oidc_use_https: bool = True
oidc_max_poll_time: int = 5 * 60 # 5 minutes
Expand Down
2 changes: 1 addition & 1 deletion armasec_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def logout():
def set_config(
domain: str = typer.Option(..., help="The domain used by your OIDC provider"),
audience: str = typer.Option(
...,
None,
help="The audience required by your OIDC provider",
),
client_id: str = typer.Option(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "armasec"
version = "2.0.2"
version = "2.0.3"
description = "Injectable FastAPI auth via OIDC"
authors = ["Omnivector Engineering Team <info@omnivector.solutions>"]
license = "MIT"
Expand Down

0 comments on commit 94cf408

Please sign in to comment.