Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] PIP-257: Add AuthenticationProviderOpenID #19849

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
60df13a
[feat] PIP-257: Add AuthenticationProviderOpenID
michaeljmarshall Mar 17, 2023
c7474fa
Improve imports in pom.xml
michaeljmarshall Mar 17, 2023
af7e3ae
Refactor packaging: move under oidc
michaeljmarshall Mar 17, 2023
518aa08
Reorder imports
michaeljmarshall Mar 17, 2023
e93b903
Upgrade auth0 dependencies; improve claims validation
michaeljmarshall Mar 17, 2023
dcb6008
Remove some versions in child pom.xml
michaeljmarshall Mar 17, 2023
6f76bbd
Use async http client to get JWKS
michaeljmarshall Mar 20, 2023
c4bdd59
Require JWT has OIDC's required claims
michaeljmarshall Mar 20, 2023
83a512a
Remove audit logging; it belongs in framework
michaeljmarshall Mar 20, 2023
08d971a
Cleanup failure metrics
michaeljmarshall Mar 20, 2023
dd96e17
Cleanup pom.xml
michaeljmarshall Mar 20, 2023
1b46eb4
Cleanup Javadocs
michaeljmarshall Mar 20, 2023
6ea2331
Add Auth0 to license.bin.txt
michaeljmarshall Mar 20, 2023
64c8c15
Close the httpClient
michaeljmarshall Mar 28, 2023
fdf6f36
Normalize URL when getting openid-configuration
michaeljmarshall Mar 29, 2023
3d96294
Cover invalid audience claim in integration tests
michaeljmarshall Mar 29, 2023
941a9f5
Improve failure scenario coverage in integration tests
michaeljmarshall Mar 29, 2023
bc4e421
Add support for k8s Api Server
michaeljmarshall Mar 29, 2023
dadbf4c
Support a custom trust store for issuers http client
michaeljmarshall Mar 29, 2023
7340b0e
Improve config name for openIDRequireIssuersUseHttps
michaeljmarshall Mar 29, 2023
932dcd7
Add k8s discover mode to support EKS, AKS, GKE
michaeljmarshall Mar 29, 2023
5eccb86
Make discovery mode more abstract to enable future additions
michaeljmarshall Mar 29, 2023
ecb5566
Remove test dependency on hard coded port
michaeljmarshall Apr 7, 2023
fa93b4c
Refactor to support refreshAfterWrite
michaeljmarshall Apr 7, 2023
a94315b
Remove unused import
michaeljmarshall Apr 7, 2023
f4b18a0
Exclude io.prometheus:simpdleclient_httpserver from k8s client
michaeljmarshall Apr 8, 2023
511b27a
Remove trailing / from issuer per OIDC Discovery Section 4.1
michaeljmarshall Apr 10, 2023
860ceff
Require token has role claim
michaeljmarshall Apr 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[feat] PIP-257: Add AuthenticationProviderOpenID
  • Loading branch information
michaeljmarshall committed Mar 17, 2023
commit 60df13aac6f36845d36320602a8de901496e671a
6 changes: 6 additions & 0 deletions distribution/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-broker-auth-oidc</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-broker-auth-sasl</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,7 @@ flexible messaging model and an intuitive client API.</description>
<module>pulsar-broker-auth-athenz</module>
<module>pulsar-client-auth-athenz</module>
<module>pulsar-sql</module>
<module>pulsar-broker-auth-oidc</module>
<module>pulsar-broker-auth-sasl</module>
<module>pulsar-client-auth-sasl</module>
<module>pulsar-config-validation</module>
Expand Down Expand Up @@ -2198,6 +2199,7 @@ flexible messaging model and an intuitive client API.</description>
<module>pulsar-websocket</module>
<module>pulsar-proxy</module>
<module>pulsar-testclient</module>
<module>pulsar-broker-auth-oidc</module>
<module>pulsar-broker-auth-sasl</module>
<module>pulsar-client-auth-sasl</module>
<module>pulsar-config-validation</module>
Expand Down
179 changes: 179 additions & 0 deletions pulsar-broker-auth-oidc/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<?xml version="1.0"?>
<!--

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.

-->
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar</artifactId>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>pulsar-broker-auth-oidc</artifactId>
<packaging>jar</packaging>
<description>Open ID Connect authentication plugin for broker</description>

<properties>
<jsonwebtoken.version>0.11.5</jsonwebtoken.version>
</properties>

<dependencies>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-broker</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-proxy</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>testmocks</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.19.2</version>
</dependency>

<dependency>
<groupId>com.auth0</groupId>
<artifactId>jwks-rsa</artifactId>
<version>0.21.1</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-broker-common</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.1.1</version>
michaeljmarshall marked this conversation as resolved.
Show resolved Hide resolved
</dependency>

<dependency>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client</artifactId>
<version>2.12.1</version>
michaeljmarshall marked this conversation as resolved.
Show resolved Hide resolved
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>${jsonwebtoken.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>${jsonwebtoken.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<version>2.35.0</version>
michaeljmarshall marked this conversation as resolved.
Show resolved Hide resolved
<scope>test</scope>
</dependency>

</dependencies>

<profiles>
<profile>
<!-- enables builds with -Dmaven.test.skip=true -->
<id>test-jar-dependencies</id>
<activation>
<property>
<name>maven.test.skip</name>
<value>!true</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-broker</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
</dependencies>
</profile>
</profiles>


<build>
<plugins>
<plugin>
<groupId>org.gaul</groupId>
<artifactId>modernizer-maven-plugin</artifactId>
<configuration>
<failOnViolations>true</failOnViolations>
<javaVersion>8</javaVersion>
</configuration>
<executions>
<execution>
<id>modernizer</id>
<phase>verify</phase>
<goals>
<goal>modernizer</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<id>checkstyle</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -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.pulsar.broker.authentication;
michaeljmarshall marked this conversation as resolved.
Show resolved Hide resolved

/**
* Enum used to classify the types of exceptions encountered
* when attempting JWT verification.
*/
public enum AuthenticationExceptionCode {
UNSUPPORTED_ISSUER,
UNSUPPORTED_ALGORITHM,
ISSUER_MISMATCH,
ALGORITHM_MISMATCH,
INVALID_PUBLIC_KEY,
ERROR_RETRIEVING_PROVIDER_METADATA,
ERROR_RETRIEVING_PUBLIC_KEY,
ERROR_DECODING_JWT,
ERROR_VERIFYING_JWT,
ERROR_VERIFYING_JWT_SIGNATURE,
INVALID_JWT_CLAIM,
EXPIRED_JWT,
}
Loading