Skip to content

Add support for base_url parameter in ServerBasedAPIAccessControl#69

Merged
dmgav merged 2 commits intobluesky:mainfrom
matyson:support-base-url-api-access-policy
Jun 5, 2025
Merged

Add support for base_url parameter in ServerBasedAPIAccessControl#69
dmgav merged 2 commits intobluesky:mainfrom
matyson:support-base-url-api-access-policy

Conversation

@matyson
Copy link

@matyson matyson commented May 14, 2025

Summary

Add support for base_url parameter to ServerBasedAPIAccessControl

Description

Added a base_url parameter to ServerBasedAPIAccessControl policy as an option to the current server + port parameters to generate the URL to query for authorization access.

This change enables https requests and domain names that can rely on default http ports, i.e. :80 or :443, as well as services deployed under path parameters behind a reverse proxy, e.g. https://myserver.example.com/access-api.

Motivation and Context

I wanted to setup my http-server to query an external service for authorization and it was not able to request the server since the current generated base_url does not support full URLs, so it constructs the URL without https and without a required path parameter.

Summary of Changes for Release Notes

Added

  • Add support for base_url parameter in ServerBasedAPIAccessControl policy.

How Has This Been Tested?

Since it only changes a class property initialization, would appreciate some guidance on what a relevant test would be. Should I replicate the current policy testing only changing the init argument?

@matyson matyson force-pushed the support-base-url-api-access-policy branch from 89bce0e to 2f3b54c Compare May 14, 2025 18:57
…cept base_url

the proposed discriminated union was not working and would require the creation of a subschema inside this schema, so for simplicity if base_url is included it takes priority over the server+port defaults
@matyson matyson force-pushed the support-base-url-api-access-policy branch from 2f3b54c to 500113c Compare May 14, 2025 19:03
@dmgav dmgav merged commit 5215bf9 into bluesky:main Jun 5, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants