Skip to content

Commit 0c49271

Browse files
committed
Merge branch 'stable' into fac-merge-stable-into-release1.5
2 parents 12e420b + 47c93e3 commit 0c49271

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+914
-263
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12
1+
FROM python:3.12-bookworm
22

33
RUN apt-get remove -yq docker.io docker-doc docker-compose podman-docker containerd runc 2>&1 || true
44

.github/workflows/chromatic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
fetch-depth: 0 # In order for Chromatic to correctly determine baseline commits, tot access the full Git history graph.
2626
- name: Install Node.js
27-
uses: actions/setup-node@v5
27+
uses: actions/setup-node@v6
2828
with:
2929
node-version: 22
3030
cache: 'npm'

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
- name: "Check out repository code"
9191
uses: "actions/checkout@v5"
9292
- name: Setup Node.js
93-
uses: actions/setup-node@v5
93+
uses: actions/setup-node@v6
9494
with:
9595
node-version: 22
9696
cache: 'npm'
@@ -535,7 +535,7 @@ jobs:
535535
with:
536536
submodules: true
537537
- name: Install NodeJS
538-
uses: actions/setup-node@v5
538+
uses: actions/setup-node@v6
539539
with:
540540
node-version: 22
541541
cache: 'npm'
@@ -636,7 +636,7 @@ jobs:
636636
with:
637637
submodules: true
638638
- name: Install NodeJS
639-
uses: actions/setup-node@v5
639+
uses: actions/setup-node@v6
640640
with:
641641
node-version: 22
642642
cache: 'npm'
@@ -676,7 +676,7 @@ jobs:
676676
with:
677677
submodules: true
678678
- name: Install NodeJS
679-
uses: actions/setup-node@v5
679+
uses: actions/setup-node@v6
680680
with:
681681
node-version: 22
682682
cache: 'npm'
@@ -794,7 +794,7 @@ jobs:
794794
with:
795795
submodules: true
796796
- name: Install NodeJS
797-
uses: actions/setup-node@v5
797+
uses: actions/setup-node@v6
798798
with:
799799
node-version: 22
800800
cache: 'npm'

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,40 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang
1111

1212
<!-- towncrier release notes start -->
1313

14+
## [Infrahub - v1.4.11](https://github.com/opsmill/infrahub/tree/infrahub-v1.4.11) - 2025-10-17
15+
16+
### Added
17+
18+
- The login form now automatically focuses on the first field.
19+
20+
### Fixed
21+
22+
- Frontend Updates
23+
- Consistent font size for all events in the Proposed Change timeline
24+
- Proposed Change action buttons now keep their size and does not strectch anymore
25+
- Prevent overflow on the create new relationship button within the relationship input
26+
- fixed typos
27+
28+
- SSO Fixes ([#6969](https://github.com/opsmill/infrahub/issues/6969))
29+
- Improved logging for SSO authentication to provide better debugging information
30+
- Enhanced error handling to properly support all error codes returned by identity providers
31+
32+
- Artifact Display Fixes ([#7294](https://github.com/opsmill/infrahub/issues/7294))
33+
- Correctly display XML and CSV artifacts in the UI.
34+
- Added a fallback to plain text for unsupported content types.
35+
36+
- Fix a bug that allowed duplicate attributes and/or relationships on Node or Generic schemas to be merged into the default branch,
37+
which would cause the application and workers to crash with an error message similar to the following:
38+
39+
> ValueError: SchemaName: Names of attributes and relationships must be unique : ['field_name_1', 'field_name_2']
40+
41+
Added a new CLI command `infrahub db check-duplicate-schema-fields` to resolve this duplicated schema fields issue if it appears. ([#7346](https://github.com/opsmill/infrahub/issues/7346))
42+
- Fixed an issue where boolean fields in the object Details view always displayed a checkmark, even when the value was false. ([#7372](https://github.com/opsmill/infrahub/issues/7372))
43+
- Fixed prefix utilization showing as greater than 100% after setting the pool attribute to false ([#7388](https://github.com/opsmill/infrahub/issues/7388))
44+
- Corrected the labels on the branch list and detailed view to use the correct terminology
45+
- Fixed issue with number pool popover stuck in the top-left corner and not expandable during the initial render in some cases.
46+
- Improved artifacts generation and proposed change checks performance by leveraging caching and avoiding excessive GraphQL queries.
47+
1448
## [Infrahub - v1.4.10](https://github.com/opsmill/infrahub/tree/infrahub-v1.4.10) - 2025-10-01
1549

1650
### Fixed

backend/infrahub/api/oauth2.py

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111

1212
from infrahub import config, models
1313
from infrahub.api.dependencies import get_db
14-
from infrahub.auth import get_groups_from_provider, signin_sso_account
15-
from infrahub.exceptions import GatewayError, ProcessingError
14+
from infrahub.auth import (
15+
get_groups_from_provider,
16+
signin_sso_account,
17+
validate_auth_response,
18+
)
19+
from infrahub.exceptions import ProcessingError
1620
from infrahub.log import get_logger
1721
from infrahub.message_bus.types import KVTTL
1822

1923
if TYPE_CHECKING:
20-
import httpx
21-
2224
from infrahub.database import InfrahubDatabase
2325
from infrahub.services import InfrahubServices
2426

@@ -95,7 +97,7 @@ async def token(
9597
}
9698

9799
token_response = await service.http.post(provider.token_url, data=token_data)
98-
_validate_response(response=token_response)
100+
validate_auth_response(response=token_response, provider_type="OAuth 2.0")
99101

100102
with trace.get_tracer(__name__).start_as_current_span("sso_token_request") as span:
101103
span.set_attribute("token_request_data", ujson.dumps(token_response.json()))
@@ -107,12 +109,17 @@ async def token(
107109
else:
108110
userinfo_response = await service.http.post(provider.userinfo_url, headers=headers)
109111

110-
_validate_response(response=userinfo_response)
112+
validate_auth_response(response=userinfo_response, provider_type="OAuth 2.0")
111113
user_info = userinfo_response.json()
112114
sso_groups = user_info.get("groups", []) or await get_groups_from_provider(
113115
provider=provider, service=service, payload=payload, user_info=user_info
114116
)
115117

118+
log.info(
119+
"SSO user authenticated",
120+
body={"user_name": user_info.get("name"), "groups": sso_groups},
121+
)
122+
116123
if not sso_groups and config.SETTINGS.security.sso_user_default_group:
117124
sso_groups = [config.SETTINGS.security.sso_user_default_group]
118125

@@ -134,16 +141,3 @@ async def token(
134141
return models.UserTokenWithUrl(
135142
access_token=user_token.access_token, refresh_token=user_token.refresh_token, final_url=stored_final_url
136143
)
137-
138-
139-
def _validate_response(response: httpx.Response) -> None:
140-
if 200 <= response.status_code <= 299:
141-
return
142-
143-
log.error(
144-
"Invalid response from the OAuth provider",
145-
url=response.url,
146-
status_code=response.status_code,
147-
body=response.json(),
148-
)
149-
raise GatewayError(message="Invalid response from Authentication provider")

backend/infrahub/api/oidc.py

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313

1414
from infrahub import config, models
1515
from infrahub.api.dependencies import get_db
16-
from infrahub.auth import get_groups_from_provider, signin_sso_account
17-
from infrahub.exceptions import GatewayError, ProcessingError
16+
from infrahub.auth import (
17+
get_groups_from_provider,
18+
signin_sso_account,
19+
validate_auth_response,
20+
)
21+
from infrahub.exceptions import ProcessingError
1822
from infrahub.log import get_logger
1923
from infrahub.message_bus.types import KVTTL
2024

2125
if TYPE_CHECKING:
22-
import httpx
23-
2426
from infrahub.database import InfrahubDatabase
2527
from infrahub.services import InfrahubServices
2628

@@ -69,7 +71,7 @@ async def authorize(request: Request, provider_name: str, final_url: str | None
6971
service: InfrahubServices = request.app.state.service
7072

7173
response = await service.http.get(url=provider.discovery_url)
72-
_validate_response(response=response)
74+
validate_auth_response(response=response, provider_type="OIDC")
7375
oidc_config = OIDCDiscoveryConfig(**response.json())
7476

7577
with trace.get_tracer(__name__).start_as_current_span("sso_oauth2_client_configuration") as span:
@@ -129,12 +131,12 @@ async def token(
129131
}
130132

131133
discovery_response = await service.http.get(url=provider.discovery_url)
132-
_validate_response(response=discovery_response)
134+
validate_auth_response(response=discovery_response, provider_type="OIDC")
133135

134136
oidc_config = OIDCDiscoveryConfig(**discovery_response.json())
135137

136138
token_response = await service.http.post(str(oidc_config.token_endpoint), data=token_data)
137-
_validate_response(response=token_response)
139+
validate_auth_response(response=token_response, provider_type="OIDC")
138140

139141
with trace.get_tracer(__name__).start_as_current_span("sso_token_request") as span:
140142
span.set_attribute("token_request_data", ujson.dumps(token_response.json()))
@@ -147,7 +149,7 @@ async def token(
147149
else:
148150
userinfo_response = await service.http.post(str(oidc_config.userinfo_endpoint), headers=headers)
149151

150-
_validate_response(response=userinfo_response)
152+
validate_auth_response(response=userinfo_response, provider_type="OIDC")
151153
user_info: dict[str, Any] = userinfo_response.json()
152154
sso_groups = (
153155
user_info.get("groups")
@@ -157,6 +159,11 @@ async def token(
157159
or await get_groups_from_provider(provider=provider, service=service, payload=payload, user_info=user_info)
158160
)
159161

162+
log.info(
163+
"SSO user authenticated",
164+
body={"user_name": user_info.get("name"), "groups": sso_groups},
165+
)
166+
160167
if not sso_groups and config.SETTINGS.security.sso_user_default_group:
161168
sso_groups = [config.SETTINGS.security.sso_user_default_group]
162169

@@ -180,19 +187,6 @@ async def token(
180187
)
181188

182189

183-
def _validate_response(response: httpx.Response) -> None:
184-
if 200 <= response.status_code <= 299:
185-
return
186-
187-
log.error(
188-
"Invalid response from the OIDC provider",
189-
url=response.url,
190-
status_code=response.status_code,
191-
body=response.json(),
192-
)
193-
raise GatewayError(message="Invalid response from Authentication provider")
194-
195-
196190
async def _get_id_token_groups(
197191
oidc_config: OIDCDiscoveryConfig, service: InfrahubServices, payload: dict[str, Any], client_id: str
198192
) -> list[str]:

backend/infrahub/artifacts/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class CheckArtifactCreate(BaseModel):
2525
target_kind: str = Field(..., description="The kind of the target object for this artifact")
2626
target_name: str = Field(..., description="Name of the artifact target")
2727
artifact_id: str | None = Field(default=None, description="The id of the artifact if it previously existed")
28-
query: str = Field(..., description="The name of the query to use when collecting data")
28+
query: str = Field(..., description="The name of the query to use when collecting data") # Deprecated
29+
query_id: str = Field(..., description="The id of the query to use when collecting data")
2930
timeout: int = Field(..., description="Timeout for requests used to generate this artifact")
3031
variables: dict = Field(..., description="Input variables when generating the artifact")
3132
validator_id: str = Field(..., description="The ID of the validator")

0 commit comments

Comments
 (0)