Skip to content

Commit 204b5f1

Browse files
authored
Merge branch feature/spring-cloud-azure-passwordless-connection to main branch (Azure#31373)
Merge branch feature/spring-cloud-azure-passwordless-connection to main branch
1 parent cd7fa29 commit 204b5f1

File tree

119 files changed

+5516
-77
lines changed

Some content is hidden

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

119 files changed

+5516
-77
lines changed

eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,12 @@ the main ServiceBusClientBuilder. -->
366366
<suppress checks="com.azure.tools.checkstyle.checks.ServiceClientCheck" files="com.azure.messaging.eventhubs.(EventHubBufferedProducerClient|EventHubBufferedProducerAsyncClient).java"/>
367367
<suppress checks="com.azure.tools.checkstyle.checks.UseCaughtExceptionCauseCheck" files="com.azure.messaging.eventhubs.EventDataBatch.java"/>
368368

369+
<!-- jdbc sdk suppression -->
370+
<suppress checks="com.azure.tools.checkstyle.checks.ExternalDependencyExposedCheck"
371+
files="com.azure.identity.providers.(mysql|postgresql).(AzureIdentityMysqlAuthenticationPlugin|AzureIdentityPostgresqlAuthenticationPlugin).java"/>
372+
<suppress checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck"
373+
files="com.azure.identity.providers.postgresql.AzureIdentityPostgresqlAuthenticationPlugin"/>
374+
369375
<!-- ### begin: Spring related suppression -->
370376

371377
<!-- The constant name is public static. -->

eng/code-quality-reports/src/main/resources/revapi/revapi.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,18 @@
408408
"new": "interface com.azure.spring.cloud.config.AppConfigurationRefresh",
409409
"justification": "Thi isn't an external class"
410410
},
411+
{
412+
"regex": true,
413+
"code": "java\\.class\\.externalClassExposedInAPI",
414+
"new": "(interface|class|enum) com\\.mysql\\.cj\\..*",
415+
"justification": "Mysql driver classes are allowed to be exposed by dependencies using them."
416+
},
417+
{
418+
"regex": true,
419+
"code": "java\\.class\\.externalClassExposedInAPI",
420+
"new": "(interface|class|enum) org\\.postgresql\\..*",
421+
"justification": "Postgresql driver classes are allowed to be exposed by dependencies using them."
422+
},
411423
{
412424
"code": "java.method.parameterTypeParameterChanged",
413425
"old": "parameter <T> reactor.core.publisher.Mono<T> com.azure.spring.data.cosmos.core.ReactiveCosmosOperations::insert(java.lang.String, ===java.lang.Object===, com.azure.cosmos.models.PartitionKey)",

eng/jacoco-test-coverage/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,16 @@
527527
<artifactId>spring-cloud-azure-starter-keyvault</artifactId>
528528
<version>4.5.0-beta.2</version> <!-- {x-version-update;com.azure.spring:spring-cloud-azure-starter-keyvault;current} -->
529529
</dependency>
530+
<dependency>
531+
<groupId>com.azure.spring</groupId>
532+
<artifactId>spring-cloud-azure-starter-jdbc-mysql</artifactId>
533+
<version>4.5.0-beta.2</version> <!-- {x-version-update;com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;current} -->
534+
</dependency>
535+
<dependency>
536+
<groupId>com.azure.spring</groupId>
537+
<artifactId>spring-cloud-azure-starter-jdbc-postgresql</artifactId>
538+
<version>4.5.0-beta.2</version> <!-- {x-version-update;com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;current} -->
539+
</dependency>
530540
<dependency>
531541
<groupId>com.azure.spring</groupId>
532542
<artifactId>spring-cloud-azure-starter-keyvault-certificates</artifactId>

eng/versioning/external_dependencies.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ org.spockframework:spock-core;2.2-M3-groovy-2.5
251251
groovy4_org.spockframework:spock-core;2.2-M3-groovy-4.0
252252
org.testng:testng;7.3.0
253253
uk.org.lidalia:slf4j-test;1.2.0
254+
uk.org.webcompere:system-stubs-jupiter;2.0.1
254255
com.google.truth:truth;1.1.3
255256

256257
## Maven Tools versions

eng/versioning/version_client.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ com.azure:azure-verticals-agrifood-farming;1.0.0-beta.2;1.0.0-beta.3
167167
com.azure:azure-xml;1.0.0-beta.1;1.0.0-beta.2
168168
com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1
169169
com.azure:azure-communication-email;1.0.0-beta.1;1.0.0-beta.2
170+
com.azure:azure-identity-providers-core;1.0.0-beta.1;1.0.0-beta.2
171+
com.azure:azure-identity-providers-jdbc-mysql;1.0.0-beta.1;1.0.0-beta.2
172+
com.azure:azure-identity-providers-jdbc-postgresql;1.0.0-beta.1;1.0.0-beta.2
170173
com.azure.spring:azure-spring-cloud-appconfiguration-config-web;2.9.0;2.10.0-beta.1
171174
com.azure.spring:azure-spring-cloud-appconfiguration-config;2.9.0;2.10.0-beta.1
172175
com.azure.spring:azure-spring-cloud-feature-management-web;2.8.0;2.9.0-beta.1
@@ -194,6 +197,8 @@ com.azure.spring:spring-cloud-azure-starter-appconfiguration;4.4.0;4.5.0-beta.2
194197
com.azure.spring:spring-cloud-azure-starter-cosmos;4.4.0;4.5.0-beta.2
195198
com.azure.spring:spring-cloud-azure-starter-data-cosmos;4.4.0;4.5.0-beta.2
196199
com.azure.spring:spring-cloud-azure-starter-eventhubs;4.4.0;4.5.0-beta.2
200+
com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;4.5.0-beta.1;4.5.0-beta.2
201+
com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;4.5.0-beta.1;4.5.0-beta.2
197202
com.azure.spring:spring-cloud-azure-starter-keyvault;4.4.0;4.5.0-beta.2
198203
com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;4.4.0;4.5.0-beta.2
199204
com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;4.4.0;4.5.0-beta.2
@@ -375,7 +380,6 @@ com.azure.resourcemanager:azure-resourcemanager-devhub;1.0.0-beta.1;1.0.0-beta.2
375380
com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1
376381
com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2
377382

378-
379383
# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current
380384
# version. Unreleased dependencies are only valid for dependency versions.
381385
# Format;
@@ -393,3 +397,4 @@ unreleased_com.azure:azure-ai-formrecognizer;4.0.0
393397
# beta_<groupId>:<artifactId>;dependency-version
394398
# note: Released beta versions will not be manipulated with the automatic PR creation code.
395399
beta_com.azure:azure-communication-common;1.3.0-beta.1
400+
beta_com.azure:azure-identity;1.7.0-beta.1

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
<module>sdk/imagebuilder</module>
9292
<module>sdk/iotcentral</module>
9393
<module>sdk/iothub</module>
94+
<module>sdk/jdbc</module>
9495
<module>sdk/keyvault</module>
9596
<module>sdk/kubernetesconfiguration</module>
9697
<module>sdk/kusto</module>

sdk/boms/spring-cloud-azure-dependencies/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
<type>pom</type>
5656
<scope>import</scope>
5757
</dependency>
58+
<!-- TODO (zhihaoguo): Pin the version of azure-identity to 1.6.0-beta.1 for we want to use the caching ability for MI. -->
59+
<dependency>
60+
<groupId>com.azure</groupId>
61+
<artifactId>azure-identity</artifactId>
62+
<version>1.7.0-beta.1</version> <!-- {x-version-update;beta_com.azure:azure-identity;dependency} -->
63+
</dependency>
5864
<dependency>
5965
<groupId>com.azure</groupId>
6066
<artifactId>azure-spring-data-cosmos</artifactId>
@@ -66,6 +72,18 @@
6672
<version>2.19.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager;dependency} -->
6773
</dependency>
6874

75+
<dependency>
76+
<groupId>com.azure</groupId>
77+
<artifactId>azure-identity-providers-jdbc-mysql</artifactId>
78+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-identity-providers-jdbc-mysql;dependency} -->
79+
</dependency>
80+
81+
<dependency>
82+
<groupId>com.azure</groupId>
83+
<artifactId>azure-identity-providers-jdbc-postgresql</artifactId>
84+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-identity-providers-jdbc-postgresql;dependency} -->
85+
</dependency>
86+
6987
<!-- Spring Cloud Azure -->
7088
<dependency>
7189
<groupId>com.azure.spring</groupId>
@@ -282,6 +300,16 @@
282300
<artifactId>spring-messaging-azure-storage-queue</artifactId>
283301
<version>${project.version}</version>
284302
</dependency>
303+
<dependency>
304+
<groupId>com.azure.spring</groupId>
305+
<artifactId>spring-cloud-azure-starter-jdbc-mysql</artifactId>
306+
<version>${project.version}</version>
307+
</dependency>
308+
<dependency>
309+
<groupId>com.azure.spring</groupId>
310+
<artifactId>spring-cloud-azure-starter-jdbc-postgresql</artifactId>
311+
<version>${project.version}</version>
312+
</dependency>
285313
</dependencies>
286314
</dependencyManagement>
287315

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Release History
2+
3+
## 1.0.0-beta.2 (Unreleased)
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
### Other Changes
12+
13+
## 1.0.0-beta.1 (2022-09-23)
14+
15+
### Features Added
16+
- Azure identity JDBC plugin library for Java. This package contains a template framework to get a token as password.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Azure identity JDBC plugin library for Java
2+
3+
This package contains a template framework to get a token from Azure AD.
4+
For now, it is used by `azure-identity-providers-jdbc-mysql` and `azure-identity-providers-jdbc-postgresql` as the common framework
5+
to get a token as the password for connection.
6+
7+
## Getting started
8+
9+
### Prerequisites
10+
11+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
12+
- [Java Development Kit (JDK)][jdk] with version 8 or above.
13+
- [Apache Maven](https://maven.apache.org/download.cgi).
14+
15+
## Key concepts
16+
17+
Azure Identity Providers Core contains a common template framework for users to get a token from Azure AD and
18+
use the token as a password. For example, to connect Azure hosted MySQL, get a token from Azure AD and use the
19+
token as a password to connect with MySQL.
20+
21+
## Examples
22+
23+
## Troubleshooting
24+
If you encounter any bugs, please file issues via [Issues](https://github.com/Azure/azure-sdk-for-java/issues).
25+
26+
## Next steps
27+
28+
## Contributing
29+
30+
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
31+
32+
1. Fork it
33+
1. Create your feature branch (`git checkout -b my-new-feature`)
34+
1. Commit your changes (`git commit -am 'Add some feature'`)
35+
1. Push to the branch (`git push origin my-new-feature`)
36+
1. Create new Pull Request
37+
38+
39+
<!-- LINKS -->
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>com.azure</groupId>
7+
<artifactId>azure-client-sdk-parent</artifactId>
8+
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
9+
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
10+
</parent>
11+
12+
<groupId>com.azure</groupId>
13+
<artifactId>azure-identity-providers-core</artifactId>
14+
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure:azure-identity-providers-core;current} -->
15+
<packaging>jar</packaging>
16+
17+
<name>Azure Identity Providers Core</name>
18+
<description>This package contains the business logic of authenticating with Azure AD and returning a token as a password.</description>
19+
<url>https://github.com/azure/azure-sdk-for-java</url>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>com.azure</groupId>
24+
<artifactId>azure-identity</artifactId>
25+
<version>1.7.0-beta.1</version> <!-- {x-version-update;beta_com.azure:azure-identity;dependency} -->
26+
</dependency>
27+
28+
<!-- test -->
29+
<dependency>
30+
<groupId>uk.org.webcompere</groupId>
31+
<artifactId>system-stubs-jupiter</artifactId>
32+
<version>2.0.1</version> <!-- {x-version-update;uk.org.webcompere:system-stubs-jupiter;external_dependency} -->
33+
<scope>test</scope>
34+
</dependency>
35+
36+
<dependency>
37+
<groupId>org.mockito</groupId>
38+
<artifactId>mockito-core</artifactId>
39+
<version>4.5.1</version> <!-- {x-version-update;org.mockito:mockito-core;external_dependency} -->
40+
<scope>test</scope>
41+
</dependency>
42+
43+
<dependency>
44+
<groupId>org.junit.jupiter</groupId>
45+
<artifactId>junit-jupiter</artifactId>
46+
<version>5.8.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter;external_dependency} -->
47+
<scope>test</scope>
48+
</dependency>
49+
50+
<dependency>
51+
<groupId>com.google.code.findbugs</groupId>
52+
<artifactId>jsr305</artifactId>
53+
<version>3.0.2</version> <!-- {x-version-update;com.google.code.findbugs:jsr305;external_dependency} -->
54+
<scope>provided</scope>
55+
</dependency>
56+
</dependencies>
57+
58+
<build>
59+
<plugins>
60+
<plugin>
61+
<groupId>org.apache.maven.plugins</groupId>
62+
<artifactId>maven-enforcer-plugin</artifactId>
63+
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
64+
<configuration>
65+
<rules>
66+
<bannedDependencies>
67+
<includes>
68+
<include>org.postgresql:postgresql:[42.3.7]</include> <!-- {x-include-update;org.postgresql:postgresql;external_dependency} -->
69+
</includes>
70+
</bannedDependencies>
71+
</rules>
72+
</configuration>
73+
</plugin>
74+
<!-- START: Empty Java Doc -->
75+
<!-- The following code will generate an empty javadoc with just a README.md. This is necessary
76+
to pass the required checks on Maven. The way this works is by setting the classesDirectory
77+
to a directory that only contains the README.md, which we need to copy. If the classesDirectory
78+
is set to the root, where the README.md lives, it still won't have javadocs but the jar file
79+
will contain a bunch of files that shouldn't be there. The faux sources directory is deleted
80+
and recreated with the README.md being copied every time to guarantee that, when building locally,
81+
it'll have the latest copy of the README.md file.
82+
-->
83+
<plugin>
84+
<groupId>org.apache.maven.plugins</groupId>
85+
<artifactId>maven-javadoc-plugin</artifactId>
86+
<version>3.3.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-javadoc-plugin;external_dependency} -->
87+
<executions>
88+
<execution>
89+
<id>attach-javadocs</id>
90+
<goals>
91+
<goal>jar</goal>
92+
</goals>
93+
<configuration>
94+
<skip>true</skip>
95+
</configuration>
96+
</execution>
97+
</executions>
98+
</plugin>
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-jar-plugin</artifactId>
102+
<version>3.1.2</version> <!-- {x-version-update;org.apache.maven.plugins:maven-jar-plugin;external_dependency} -->
103+
<executions>
104+
<execution>
105+
<id>empty-javadoc-jar-with-readme</id>
106+
<phase>package</phase>
107+
<goals>
108+
<goal>jar</goal>
109+
</goals>
110+
<configuration>
111+
<classifier>javadoc</classifier>
112+
<classesDirectory>${project.basedir}/javadocTemp</classesDirectory>
113+
</configuration>
114+
</execution>
115+
</executions>
116+
</plugin>
117+
<plugin>
118+
<groupId>org.apache.maven.plugins</groupId>
119+
<artifactId>maven-antrun-plugin</artifactId>
120+
<version>1.8</version> <!-- {x-version-update;org.apache.maven.plugins:maven-antrun-plugin;external_dependency} -->
121+
<executions>
122+
<execution>
123+
<id>copy-readme-to-javadocTemp</id>
124+
<phase>prepare-package</phase>
125+
<configuration>
126+
<target>
127+
<echo>Deleting existing ${project.basedir}/javadocTemp</echo>
128+
<delete includeEmptyDirs="true" quiet="true">
129+
<fileset dir="${project.basedir}/javadocTemp"/>
130+
</delete>
131+
<echo>Copying ${project.basedir}/README.md to
132+
${project.basedir}/javadocTemp/README.md
133+
</echo>
134+
<copy file="${project.basedir}/README.md" tofile="${project.basedir}/javadocTemp/README.md"/>
135+
</target>
136+
</configuration>
137+
<goals>
138+
<goal>run</goal>
139+
</goals>
140+
</execution>
141+
</executions>
142+
</plugin>
143+
<!-- END: Empty Java Doc -->
144+
<plugin>
145+
<groupId>org.apache.maven.plugins</groupId>
146+
<artifactId>maven-surefire-plugin</artifactId>
147+
<version>3.0.0-M7</version><!-- {x-version-update;org.apache.maven.plugins:maven-surefire-plugin;external_dependency} -->
148+
<configuration>
149+
<reuseForks>false</reuseForks>
150+
</configuration>
151+
</plugin>
152+
</plugins>
153+
</build>
154+
155+
</project>

0 commit comments

Comments
 (0)