You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "visit2rahul (via GitHub)" <gi...@apache.org> on 2026/08/15 00:01:21 UTC

[PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

visit2rahul opened a new pull request, #5294:
URL: https://github.com/apache/polaris/pull/5294

   Quarkus 3.25+ has built-in support for RFC 9728 (OAuth 2.0 Protected Resource Metadata). When enabled it serves \`/.well-known/oauth-protected-resource\`, which lets catalog clients auto-discover the authorization server URL from the catalog URI instead of requiring it in their config.
   
   This wires it up for Polaris: adds the \`quarkus.oidc.resource-metadata.*\` properties to \`application.properties\` next to the existing OIDC block (including the \`authorization-server\` override), and a \`@QuarkusTest\` that enables the feature with OIDC discovery disabled so no live auth server is needed, then verifies the endpoint returns the expected \`authorization_servers\` value.
   
   Closes #2581


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "visit2rahul (via GitHub) via issues" <is...@polaris.apache.org>.
visit2rahul commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4585789904


##########
site/content/in-dev/unreleased/managing-security/external-idp/_index.md:
##########
@@ -130,6 +130,16 @@ quarkus.oidc.auth-server-url=https://auth.example.com/realms/polaris
 quarkus.oidc.client-id=polaris
 ```
 
+Once a tenant is enabled, you can optionally advertise the authorization server via the OAuth 2.0 Protected Resource Metadata endpoint (`/.well-known/oauth-protected-resource`, [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)). This lets clients auto-discover the authorization server from the catalog URL without extra configuration:
+
+```properties
+quarkus.oidc.resource-metadata.enabled=true
+quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog

Review Comment:
   yea ur right, one value per tenant.. docs say only /api/catalog is covered now, not /api/management



##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -105,6 +105,16 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so catalog clients can
+# auto-discover the authorization server URL from the catalog URI without extra configuration.
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog
+# Set to the public catalog URL so clients can discover the authorization server from it.

Review Comment:
   done, thanks



##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -111,6 +111,18 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so Polaris advertises the
+# authorization server for the catalog API. This is server-side metadata only -- it benefits
+# clients that already support RFC 9728 discovery; it does not change behavior for clients
+# that don't (including the Iceberg REST client today).
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog
+# Set to the OIDC server URL so clients can discover the authorization server from it.
+# If omitted, Quarkus derives the identifier from the incoming request URL.

Review Comment:
   yea u got it, i had it backwards.. resource falls back to the incoming request if blank, authorization-server falls back to auth-server-url. fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "visit2rahul (via GitHub) via issues" <is...@polaris.apache.org>.
visit2rahul commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4624301106


##########
site/content/in-dev/unreleased/managing-security/external-idp/_index.md:
##########
@@ -140,6 +140,22 @@ quarkus.oidc.oidc-tenant1.application-type=service
 
 When using multiple OIDC tenants, it's your responsibility to configure tenant resolution appropriately. See the [Quarkus OpenID Connect Multitenancy Guide](https://quarkus.io/guides/security-openid-connect-multitenancy#tenant-resolution).  
 
+### OAuth 2.0 Protected Resource Metadata (RFC 9728)
+
+Independently of tenant configuration, once a tenant is enabled you can optionally advertise its authorization server via the OAuth 2.0 Protected Resource Metadata endpoint (`/.well-known/oauth-protected-resource`, [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)):
+
+```properties
+quarkus.oidc.resource-metadata.enabled=true
+quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog

Review Comment:
   possible and I think makes more sense.. switched.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "orca-review-bot (via GitHub)" <gi...@apache.org>.
orca-review-bot commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4416797866


##########
CHANGELOG.md:
##########
@@ -115,6 +115,9 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
 - Python CLI: added `namespaces update` to set and remove namespace properties
 - NoSQL: the commit retry settings are now configurable via `polaris.persistence.retry.*`
 - Python CLI: added global `--ssl-ca-cert` and `--insecure` options to verify the server with a custom CA bundle or to disable TLS certificate verification
+- Python CLI: `catalogs update` now supports `--no-sts` and `--no-kms` to toggle STS/KMS availability on an existing S3 catalog. Previously these were only settable at `catalogs create` time.

Review Comment:
   This line and the next one (`gcp` auth type) are already under [1.8.0] on main, so they'd show up twice. Looks like a rebase leftover. Can we drop both and keep only the RFC 9728 entry?
   
   <sub>🤖 AI-generated review comment — agents make mistakes, so please verify before acting on it.</sub>



##########
runtime/service/src/test/java/org/apache/polaris/service/auth/oidc/OAuthProtectedResourceMetadataTest.java:
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.auth.oidc;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import com.google.common.collect.ImmutableMap;
+import io.quarkus.test.junit.QuarkusTest;
+import io.quarkus.test.junit.TestProfile;
+import io.restassured.path.json.JsonPath;
+import java.util.Map;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Verifies that enabling {@code quarkus.oidc.resource-metadata.enabled} causes Polaris to serve the
+ * OAuth 2.0 Protected Resource Metadata endpoint ({@code /.well-known/oauth-protected-resource} per
+ * RFC 9728), advertising the authorization server backing the WireMock-issued OIDC tenant used by
+ * {@link AbstractOidcAuthTest}.
+ *
+ * <p>This is purely a discovery document: Quarkus 3.40 does not add a {@code resource_metadata}
+ * hint to {@code WWW-Authenticate} challenges on unauthenticated requests (verified against the
+ * {@code quarkus-oidc}/{@code quarkus-vertx-http} 3.40.1.1 bytecode -- no such string exists), so

Review Comment:
   The bit about checking the 3.40.1.1 bytecode will go stale on the next Quarkus bump. Can we shorten it to "Quarkus doesn't add a resource_metadata hint to WWW-Authenticate today"?
   
   <sub>🤖 AI-generated review comment — agents make mistakes, so please verify before acting on it.</sub>



##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -111,6 +111,18 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so Polaris advertises the
+# authorization server for the catalog API. This is server-side metadata only -- it benefits
+# clients that already support RFC 9728 discovery; it does not change behavior for clients
+# that don't (including the Iceberg REST client today).
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog
+# Set to the OIDC server URL so clients can discover the authorization server from it.
+# If omitted, Quarkus derives the identifier from the incoming request URL.

Review Comment:
   I couldn't confirm this one. My reading of the Quarkus docs is that an omitted `authorization-server` falls back to the tenant's `auth-server-url`, and that it's `resource` that gets derived from the request URL. Can you check which default this sentence is describing?
   
   <sub>🤖 AI-generated review comment — agents make mistakes, so please verify before acting on it.</sub>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "flyrain (via GitHub) via issues" <is...@polaris.apache.org>.
flyrain commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4638606935


##########
runtime/service/src/test/java/org/apache/polaris/service/auth/oidc/OAuthProtectedResourceMetadataDisabledTest.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.auth.oidc;
+
+import static io.restassured.RestAssured.given;
+
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Verifies the default, disabled state of {@code quarkus.oidc.resource-metadata.enabled} (see
+ * {@link OAuthProtectedResourceMetadataTest} for the enabled case): with no overrides, the
+ * well-known endpoint is not served at all.
+ */
+@QuarkusTest
+class OAuthProtectedResourceMetadataDisabledTest {
+
+  @Test
+  void wellKnownEndpointIsNotServedByDefault() {
+    given().get("/.well-known/oauth-protected-resource/api/catalog").then().statusCode(404);

Review Comment:
   nit: building on @dimas-b's question, this test can't catch a wrong default as written. In the default profile the OIDC tenant is off (`quarkus.oidc.tenant-enabled=false`), so the 404 would show up even if `resource-metadata.enabled` defaulted to true.
   
   Can we either run it with an OIDC-enabled profile (`AbstractOidcAuthTest.Profile` without the metadata flag, hitting `/.well-known/oauth-protected-resource/api`), or drop it?



##########
site/content/in-dev/unreleased/managing-security/external-idp/_index.md:
##########
@@ -140,6 +140,22 @@ quarkus.oidc.oidc-tenant1.application-type=service
 
 When using multiple OIDC tenants, it's your responsibility to configure tenant resolution appropriately. See the [Quarkus OpenID Connect Multitenancy Guide](https://quarkus.io/guides/security-openid-connect-multitenancy#tenant-resolution).  
 
+### OAuth 2.0 Protected Resource Metadata (RFC 9728)
+
+Independently of tenant configuration, once a tenant is enabled you can optionally advertise its authorization server via the OAuth 2.0 Protected Resource Metadata endpoint (`/.well-known/oauth-protected-resource`, [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)):
+
+```properties
+quarkus.oidc.resource-metadata.enabled=true
+quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api
+quarkus.oidc.resource-metadata.authorization-server=https://auth.example.com/realms/polaris
+```
+
+This is server-side metadata only: Polaris publishes the document, but a client has to already support RFC 9728 discovery to use it. The Iceberg REST client does not do this today, and most clients currently don't either -- enabling this setting does not by itself change how existing Iceberg/Spark clients authenticate against Polaris. It benefits clients and tooling that are (or become) RFC 9728-aware.

Review Comment:
   Quick docs thing: this says the endpoint is `/.well-known/oauth-protected-resource`, but with `resource=.../api` the URL a client actually fetches is `/.well-known/oauth-protected-resource/api`. RFC 9728 puts the well-known prefix in front of the resource path, and right now that only shows up in the test.
   
   Can we spell out the full URL here and add a short sample response (`resource` and `authorization_servers`)?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "visit2rahul (via GitHub) via issues" <is...@polaris.apache.org>.
visit2rahul commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4624277538


##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -105,6 +105,15 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so catalog clients can
+# auto-discover the authorization server URL from the catalog URI without extra configuration.
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com
+# quarkus.oidc.resource-metadata.authorization-server=https://auth.example.com/realms/polaris
+# quarkus.oidc.resource-metadata.scopes=catalog

Review Comment:
   dropped it, yea it was never a real polaris scope



##########
runtime/service/src/test/java/org/apache/polaris/service/auth/OAuthProtectedResourceMetadataTest.java:
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.auth;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.quarkus.test.junit.QuarkusTestProfile;
+import io.quarkus.test.junit.TestProfile;
+import io.restassured.path.json.JsonPath;
+import java.util.Map;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Verifies that enabling {@code quarkus.oidc.resource-metadata.enabled} causes Polaris to serve the
+ * OAuth 2.0 Protected Resource Metadata endpoint ({@code /.well-known/oauth-protected-resource} per
+ * RFC 9728). The endpoint lets catalog clients auto-discover the authorization server URL from the
+ * catalog URI without requiring explicit configuration.
+ */
+@QuarkusTest
+@TestProfile(OAuthProtectedResourceMetadataTest.ResourceMetadataProfile.class)
+class OAuthProtectedResourceMetadataTest {
+
+  static final String AUTH_SERVER_URL = "https://auth.example.com/realms/polaris";
+
+  public static class ResourceMetadataProfile implements QuarkusTestProfile {
+    @Override
+    public Map<String, String> getConfigOverrides() {
+      return Map.ofEntries(
+          // Enable the OIDC tenant so the ResourceMetadataHandler registers the route.
+          Map.entry("quarkus.oidc.tenant-enabled", "true"),
+          // Disable OIDC discovery so Quarkus does not attempt to contact the auth server
+          // at startup. The well-known endpoint is public and requires no JWT validation.
+          Map.entry("quarkus.oidc.discovery-enabled", "false"),
+          Map.entry("quarkus.oidc.auth-server-url", "https://auth.example.com/realms/polaris"),
+          // Required by Quarkus when discovery is disabled; not called by the test since
+          // /.well-known/oauth-protected-resource is unauthenticated.
+          Map.entry("quarkus.oidc.jwks-path", "protocol/openid-connect/certs"),
+          // Defer JWKS loading to first authenticated request so startup does not attempt to
+          // fetch JWKS from the test auth-server-url. Without this the tenant stays "not ready"
+          // and ResourceMetadataHandler never registers the route.
+          Map.entry("quarkus.oidc.jwks.resolve-early", "false"),
+          Map.entry("quarkus.oidc.resource-metadata.enabled", "true"),
+          Map.entry("quarkus.oidc.resource-metadata.authorization-server", AUTH_SERVER_URL));
+    }
+  }
+
+  @Test
+  void wellKnownEndpointAdvertisesAuthorizationServer() {
+    String body =
+        given()
+            .get("/.well-known/oauth-protected-resource")

Review Comment:
   fixed a while back, test now hits the actual path not host-root. sorry for the radio silence on this one



##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -105,6 +105,16 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so catalog clients can
+# auto-discover the authorization server URL from the catalog URI without extra configuration.
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com

Review Comment:
   same here, example uses the real path now



##########
site/content/in-dev/unreleased/managing-security/external-idp/_index.md:
##########


Review Comment:
   added that, doc now says explicitly this is the single-tenant case



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #5294:
URL: https://github.com/apache/polaris/pull/5294#issuecomment-5431527722

   Thanks @visit2rahul for the PR. I'm not sure how a IRC client(e.g., spark + iceberg plugin) work with this setting. Would you mind elaborate it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "visit2rahul (via GitHub) via issues" <is...@polaris.apache.org>.
visit2rahul commented on PR #5294:
URL: https://github.com/apache/polaris/pull/5294#issuecomment-6916606102

   @flyrain sorry for the late reply on this.. short answer is it doesnt change anything for spark/iceberg today. its a discovery doc, only helps a client that already knows to look for it and most dont yet. more forward looking than something useful right now


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "visit2rahul (via GitHub) via issues" <is...@polaris.apache.org>.
visit2rahul commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4624297486


##########
runtime/service/src/test/java/org/apache/polaris/service/auth/oidc/OAuthProtectedResourceMetadataDisabledTest.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.auth.oidc;
+
+import static io.restassured.RestAssured.given;
+
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Verifies the default, disabled state of {@code quarkus.oidc.resource-metadata.enabled} (see
+ * {@link OAuthProtectedResourceMetadataTest} for the enabled case): with no overrides, the
+ * well-known endpoint is not served at all.
+ */
+@QuarkusTest
+class OAuthProtectedResourceMetadataDisabledTest {
+
+  @Test
+  void wellKnownEndpointIsNotServedByDefault() {
+    given().get("/.well-known/oauth-protected-resource/api/catalog").then().statusCode(404);

Review Comment:
   added as a negative test case verifying discovery endpoint retuers 404  by default.  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "flyingImer (via GitHub)" <gi...@apache.org>.
flyingImer commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r3857883540


##########
site/content/in-dev/unreleased/managing-security/external-idp/_index.md:
##########


Review Comment:
   Could we clarify whether this discovery flow is intended for the default/single-OIDC-tenant case?
   
   IIRC, the section immediately below supports multiple named OIDC tenants, but a client starting with one Polaris catalog URI does not in general know which tenant-specific authorization server it should discover, and Quarkus publishes this metadata per OIDC tenant.
   
   I'm fine with initially supporting the single/default-tenant shape; I think we should just make that scope explicit rather than implying catalog-URI-only discovery works for the general multi-tenant configuration.
   



##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -105,6 +105,16 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so catalog clients can
+# auto-discover the authorization server URL from the catalog URI without extra configuration.
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com

Review Comment:
   Should this example use the actual public Polaris catalog resource, e.g. `https://catalog.example.com/api/catalog`?
   
   Since the resource path participates in RFC 9728 discovery, using only the host here teaches a different well-known URI than a client starting from the normal Polaris catalog URI would derive.
   



##########
runtime/service/src/test/java/org/apache/polaris/service/auth/OAuthProtectedResourceMetadataTest.java:
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.auth;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.quarkus.test.junit.QuarkusTestProfile;
+import io.quarkus.test.junit.TestProfile;
+import io.restassured.path.json.JsonPath;
+import java.util.Map;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Verifies that enabling {@code quarkus.oidc.resource-metadata.enabled} causes Polaris to serve the
+ * OAuth 2.0 Protected Resource Metadata endpoint ({@code /.well-known/oauth-protected-resource} per
+ * RFC 9728). The endpoint lets catalog clients auto-discover the authorization server URL from the
+ * catalog URI without requiring explicit configuration.
+ */
+@QuarkusTest
+@TestProfile(OAuthProtectedResourceMetadataTest.ResourceMetadataProfile.class)
+class OAuthProtectedResourceMetadataTest {
+
+  static final String AUTH_SERVER_URL = "https://auth.example.com/realms/polaris";
+
+  public static class ResourceMetadataProfile implements QuarkusTestProfile {
+    @Override
+    public Map<String, String> getConfigOverrides() {
+      return Map.ofEntries(
+          // Enable the OIDC tenant so the ResourceMetadataHandler registers the route.
+          Map.entry("quarkus.oidc.tenant-enabled", "true"),
+          // Disable OIDC discovery so Quarkus does not attempt to contact the auth server
+          // at startup. The well-known endpoint is public and requires no JWT validation.
+          Map.entry("quarkus.oidc.discovery-enabled", "false"),
+          Map.entry("quarkus.oidc.auth-server-url", "https://auth.example.com/realms/polaris"),
+          // Required by Quarkus when discovery is disabled; not called by the test since
+          // /.well-known/oauth-protected-resource is unauthenticated.
+          Map.entry("quarkus.oidc.jwks-path", "protocol/openid-connect/certs"),
+          // Defer JWKS loading to first authenticated request so startup does not attempt to
+          // fetch JWKS from the test auth-server-url. Without this the tenant stays "not ready"
+          // and ResourceMetadataHandler never registers the route.
+          Map.entry("quarkus.oidc.jwks.resolve-early", "false"),
+          Map.entry("quarkus.oidc.resource-metadata.enabled", "true"),
+          Map.entry("quarkus.oidc.resource-metadata.authorization-server", AUTH_SERVER_URL));
+    }
+  }
+
+  @Test
+  void wellKnownEndpointAdvertisesAuthorizationServer() {
+    String body =
+        given()
+            .get("/.well-known/oauth-protected-resource")

Review Comment:
   Wonder if we should exercise the actual Polaris catalog resource here rather than only the host-root case?
   
   For example, configure `quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog`, request the corresponding path-qualified well-known endpoint (`/.well-known/oauth-protected-resource/api/catalog`), and assert the exact `resource` value.
   
   Otherwise this proves that Quarkus can expose resource metadata, but not the PR's interoperability claim that a client can discover it starting from the Polaris catalog URI.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4340136207


##########
site/content/in-dev/unreleased/managing-security/external-idp/_index.md:
##########
@@ -130,6 +130,16 @@ quarkus.oidc.auth-server-url=https://auth.example.com/realms/polaris
 quarkus.oidc.client-id=polaris
 ```
 
+Once a tenant is enabled, you can optionally advertise the authorization server via the OAuth 2.0 Protected Resource Metadata endpoint (`/.well-known/oauth-protected-resource`, [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)). This lets clients auto-discover the authorization server from the catalog URL without extra configuration:

Review Comment:
   I think this topic deserves a separate section. It is orthogonal to the tenant configuration.
   
   Also, we say clients can auto-discover the authorization server "without extra configuration". Could we tone that down? As far as I know, this isn't something the Iceberg REST client does out of the box today. And I suspect the vast majority of clients do not have support for resource metadata yet.



##########
runtime/service/src/test/java/org/apache/polaris/service/auth/OAuthProtectedResourceMetadataTest.java:
##########
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.auth;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.quarkus.test.junit.QuarkusTestProfile;
+import io.quarkus.test.junit.TestProfile;
+import io.restassured.path.json.JsonPath;
+import java.util.Map;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Verifies that enabling {@code quarkus.oidc.resource-metadata.enabled} causes Polaris to serve the
+ * OAuth 2.0 Protected Resource Metadata endpoint ({@code /.well-known/oauth-protected-resource} per
+ * RFC 9728). The endpoint lets catalog clients auto-discover the authorization server URL from the
+ * catalog URI without requiring explicit configuration.
+ */
+@QuarkusTest
+@TestProfile(OAuthProtectedResourceMetadataTest.ResourceMetadataProfile.class)
+class OAuthProtectedResourceMetadataTest {
+
+  static final String AUTH_SERVER_URL = "https://auth.example.com/realms/polaris";
+
+  // The catalog resource URI that clients would use to derive the well-known path.
+  // RFC 9728: GET /.well-known/oauth-protected-resource<path> where <path> is the
+  // path component of the resource URI.
+  static final String CATALOG_RESOURCE = "https://catalog.example.com/api/catalog";
+
+  public static class ResourceMetadataProfile implements QuarkusTestProfile {

Review Comment:
   This test is a bit contrived. I believe that this is because we are not using a real OIDC server, so we rely on several workarounds (discovery off, `jwks.resolve-early=false`), which the comments tie to `ResourceMetadataHandler` route registration. 
   
   Instead of that, could we use a real Keycloak instance here and assert that the Keycloak address is properly advertised?
   
   Also, could we have some negative tests? E.g.
   
   1. A test that verifies the discovery endpoint returns 404 by default (OIDC off / `resource-metadata.enabled=false`)
   2. A test that verifies that an unauthorized request gets a 401 with `WWW-Authenticate: Bearer resource_metadata="..."` 



##########
site/content/in-dev/unreleased/managing-security/external-idp/_index.md:
##########
@@ -130,6 +130,16 @@ quarkus.oidc.auth-server-url=https://auth.example.com/realms/polaris
 quarkus.oidc.client-id=polaris
 ```
 
+Once a tenant is enabled, you can optionally advertise the authorization server via the OAuth 2.0 Protected Resource Metadata endpoint (`/.well-known/oauth-protected-resource`, [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)). This lets clients auto-discover the authorization server from the catalog URL without extra configuration:
+
+```properties
+quarkus.oidc.resource-metadata.enabled=true
+quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog

Review Comment:
   Polaris serves two distinct resources, `/api/catalog` (which covers the IRC API, the policy API and the generic tables API) and `/api/management`. Is advertising only the first one intentional?
   
   Per the Quarkus docs, `resource-metadata.resource` is a single value per OIDC tenant, so from my understanding (but I never tried this feature), only one resource can be advertised (per tenant). 
   
   If this limitation is true, could the docs say that only the catalog API is covered?



##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -105,6 +105,16 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so catalog clients can
+# auto-discover the authorization server URL from the catalog URI without extra configuration.
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog
+# Set to the public catalog URL so clients can discover the authorization server from it.

Review Comment:
   ```suggestion
   # Set to the OIDC server URL so clients can discover the authorization server from it.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "visit2rahul (via GitHub)" <gi...@apache.org>.
visit2rahul commented on PR #5294:
URL: https://github.com/apache/polaris/pull/5294#issuecomment-5350114622

   Thanks @vigneshio , incorporated your review feedback. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "vigneshio (via GitHub)" <gi...@apache.org>.
vigneshio commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r3814447333


##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -105,6 +105,15 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so catalog clients can
+# auto-discover the authorization server URL from the catalog URI without extra configuration.
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com

Review Comment:
   Nit: if this is left unset, quarkus invents the resource identifier. if you keep the example, say it should be the public catalog url.



##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -105,6 +105,15 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so catalog clients can
+# auto-discover the authorization server URL from the catalog URI without extra configuration.
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com
+# quarkus.oidc.resource-metadata.authorization-server=https://auth.example.com/realms/polaris
+# quarkus.oidc.resource-metadata.scopes=catalog

Review Comment:
   Nit: polaris does not define a `catalog` scope for external idps. drop this line or can we mark it as idp-specific so nobody copies it as a polaris scope.. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "visit2rahul (via GitHub)" <gi...@apache.org>.
visit2rahul commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r3817978809


##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -105,6 +105,15 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so catalog clients can
+# auto-discover the authorization server URL from the catalog URI without extra configuration.
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com

Review Comment:
   Added a note that this should be public catalog. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "adutra (via GitHub) via issues" <is...@polaris.apache.org>.
adutra commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4480199427


##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -111,6 +111,18 @@ quarkus.oidc.tenant-enabled=false
 # Named tenants:
 # quarkus.oidc.idp1.auth-server-url=https://auth.example.com/realms/polaris2
 # quarkus.oidc.idp1.client-id=polaris2
+#
+# OAuth Protected Resource Metadata (RFC 9728)
+# When quarkus.oidc.tenant-enabled=true, enable resource metadata so Polaris advertises the
+# authorization server for the catalog API. This is server-side metadata only -- it benefits
+# clients that already support RFC 9728 discovery; it does not change behavior for clients
+# that don't (including the Iceberg REST client today).
+# See https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
+# quarkus.oidc.resource-metadata.enabled=true
+# quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog
+# Set to the OIDC server URL so clients can discover the authorization server from it.
+# If omitted, Quarkus derives the identifier from the incoming request URL.

Review Comment:
   I agree here, the authorization server URL cannot be derived from an incoming request.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "dimas-b (via GitHub) via issues" <is...@polaris.apache.org>.
dimas-b commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4622914470


##########
runtime/service/src/test/java/org/apache/polaris/service/auth/oidc/OAuthProtectedResourceMetadataDisabledTest.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.auth.oidc;
+
+import static io.restassured.RestAssured.given;
+
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Verifies the default, disabled state of {@code quarkus.oidc.resource-metadata.enabled} (see
+ * {@link OAuthProtectedResourceMetadataTest} for the enabled case): with no overrides, the
+ * well-known endpoint is not served at all.
+ */
+@QuarkusTest
+class OAuthProtectedResourceMetadataDisabledTest {
+
+  @Test
+  void wellKnownEndpointIsNotServedByDefault() {
+    given().get("/.well-known/oauth-protected-resource/api/catalog").then().statusCode(404);

Review Comment:
   nit: why would we encode this behaviour in a test? Polaris itself does not produce the payload of this endpoint and it does not control the correctness of that data, so why bother? 🤷 



##########
site/content/in-dev/unreleased/managing-security/external-idp/_index.md:
##########
@@ -140,6 +140,22 @@ quarkus.oidc.oidc-tenant1.application-type=service
 
 When using multiple OIDC tenants, it's your responsibility to configure tenant resolution appropriately. See the [Quarkus OpenID Connect Multitenancy Guide](https://quarkus.io/guides/security-openid-connect-multitenancy#tenant-resolution).  
 
+### OAuth 2.0 Protected Resource Metadata (RFC 9728)
+
+Independently of tenant configuration, once a tenant is enabled you can optionally advertise its authorization server via the OAuth 2.0 Protected Resource Metadata endpoint (`/.well-known/oauth-protected-resource`, [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)):
+
+```properties
+quarkus.oidc.resource-metadata.enabled=true
+quarkus.oidc.resource-metadata.resource=https://catalog.example.com/api/catalog

Review Comment:
   why not simply `.../api`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "visit2rahul (via GitHub) via issues" <is...@polaris.apache.org>.
visit2rahul commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4585749661


##########
site/content/in-dev/unreleased/managing-security/external-idp/_index.md:
##########
@@ -130,6 +130,16 @@ quarkus.oidc.auth-server-url=https://auth.example.com/realms/polaris
 quarkus.oidc.client-id=polaris
 ```
 
+Once a tenant is enabled, you can optionally advertise the authorization server via the OAuth 2.0 Protected Resource Metadata endpoint (`/.well-known/oauth-protected-resource`, [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)). This lets clients auto-discover the authorization server from the catalog URL without extra configuration:

Review Comment:
   yes, this makes sense.. incorporated ur feedback 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "adutra (via GitHub) via issues" <is...@polaris.apache.org>.
adutra commented on PR #5294:
URL: https://github.com/apache/polaris/pull/5294#issuecomment-6943681324

   Heads-up: #5967 has been merged, so `CHANGELOG.md` is no longer edited directly. Changelog entries now go in a fragment file under `changelog.d/`, which avoids merge conflicts on `CHANGELOG.md`. See [changelog.d/README.md](https://github.com/apache/polaris/blob/main/changelog.d/README.md) for the format.
   
   Could you rebase onto `main`, revert your changes to `CHANGELOG.md`, and add a fragment file instead if your change needs a changelog entry? A fragment is only needed for things worth calling out in release notes, such as breaking changes, metastore schema changes, or changes that require manual steps during an upgrade. Thanks!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(auth): add RFC 9728 OAuth Protected Resource Metadata support [polaris]

Posted by "visit2rahul (via GitHub) via issues" <is...@polaris.apache.org>.
visit2rahul commented on code in PR #5294:
URL: https://github.com/apache/polaris/pull/5294#discussion_r4585798042


##########
runtime/service/src/test/java/org/apache/polaris/service/auth/OAuthProtectedResourceMetadataTest.java:
##########
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.auth;
+
+import static io.restassured.RestAssured.given;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.quarkus.test.junit.QuarkusTestProfile;
+import io.quarkus.test.junit.TestProfile;
+import io.restassured.path.json.JsonPath;
+import java.util.Map;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Verifies that enabling {@code quarkus.oidc.resource-metadata.enabled} causes Polaris to serve the
+ * OAuth 2.0 Protected Resource Metadata endpoint ({@code /.well-known/oauth-protected-resource} per
+ * RFC 9728). The endpoint lets catalog clients auto-discover the authorization server URL from the
+ * catalog URI without requiring explicit configuration.
+ */
+@QuarkusTest
+@TestProfile(OAuthProtectedResourceMetadataTest.ResourceMetadataProfile.class)
+class OAuthProtectedResourceMetadataTest {
+
+  static final String AUTH_SERVER_URL = "https://auth.example.com/realms/polaris";
+
+  // The catalog resource URI that clients would use to derive the well-known path.
+  // RFC 9728: GET /.well-known/oauth-protected-resource<path> where <path> is the
+  // path component of the resource URI.
+  static final String CATALOG_RESOURCE = "https://catalog.example.com/api/catalog";
+
+  public static class ResourceMetadataProfile implements QuarkusTestProfile {

Review Comment:
   fair point.. switched to the real keycloak test setup we already use elsewhere. also added the disabled/404 test..



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org