Skip to content

Commit 7ad0600

Browse files
committed
Fix #93 Do not require nakadi-producer.access-token-uri anymore
1 parent 6aa0d25 commit 7ad0600

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,9 @@ token. The easiest way to do so is to include the [Zalando Tokens library](https
116116
</dependency>
117117
```
118118

119-
This starter will detect and auto configure it. To do so, it needs to know the address of your oAuth2 server:
120-
```yaml
121-
nakadi-producer:
122-
access-token-uri: https://token.auth.example.org/oauth2/access_token
123-
```
119+
This starter will detect and auto configure it.
124120

125-
If your application is running in Zalando's Kubernetes environment, you also have to configure the credential rotation:
121+
If your application is running in Zalando's Kubernetes environment, you have to configure the credential rotation:
126122
```yaml
127123
apiVersion: "zalando.org/v1"
128124
kind: PlatformCredentialsSet
@@ -136,18 +132,27 @@ spec:
136132
privileges: []
137133
```
138134
135+
If your application is running in Zalando's STUPS environment (or you provide tokens via your own oAuth server) it needs
136+
to know the address of your oAuth2 server:
137+
```yaml
138+
nakadi-producer:
139+
access-token-uri: https://token.auth.example.org/oauth2/access_token
140+
```
141+
142+
#### OAuth (scope) configuration in a non-Zalando environment
143+
Please consult the [manual of Zalando's tokens library](https://github.com/zalando/tokens) for more configuration options (like `CREDENTIALS_DIR` or via environment variables.
144+
139145
Since [July 2017](https://github.com/zalando/nakadi/pull/692), Nakadi (at least in the version operated at Zalando) doesn't require any scopes other than the pseudo-scope `uid` for writing events, [the authorization is instead based on event-type configuration using the service's uid](https://nakadi.io/manual.html#using_authorization).
140146

141147
If your Nakadi installation needs real scopes for submitting events, you can provide them via configuration, too (as a comma-separated list):
142148

143149
```yaml
144150
nakadi-producer:
145-
access-token-uri: https://token.auth.example.org/oauth2/access_token
146151
access-token-scopes: my.scope.name,other.scope.name
147-
```
148-
149-
If you do not use the STUPS Tokens library, you can implement token retrieval yourself by defining a Spring bean of type `org.zalando.nakadiproducer.AccessTokenProvider`. The starter will detect it and call it once for each request to retrieve the token.
152+
```
150153

154+
#### Implement Nakadi authentication yourself
155+
If you do not use the STUPS Tokens library, you can implement token retrieval yourself by defining a Spring bean of type `org.zalando.nakadiproducer.AccessTokenProvider`. The starter will detect it and call it once for each request to retrieve the token.
151156

152157
### Creating events
153158

nakadi-producer-spring-boot-starter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>org.zalando</groupId>
1212
<artifactId>nakadi-producer-reactor</artifactId>
13-
<version>20.0.0</version>
13+
<version>20.0.1</version>
1414
</parent>
1515

1616
<artifactId>nakadi-producer-spring-boot-starter</artifactId>

nakadi-producer-spring-boot-starter/src/main/java/org/zalando/nakadiproducer/NakadiProducerAutoConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ public NakadiPublishingClient nakadiProducerPublishingClient(AccessTokenProvider
5757
@Configuration
5858
static class StupsTokenConfiguration {
5959
@Bean(destroyMethod = "stop")
60-
@ConditionalOnProperty({ "nakadi-producer.access-token-uri" })
6160
@ConditionalOnMissingBean(AccessTokenProvider.class)
6261
public StupsTokenComponent accessTokenProvider(
63-
@Value("${nakadi-producer.access-token-uri}") URI accessTokenUri,
62+
@Value("${nakadi-producer.access-token-uri:http://nakadi-producer.access-token-uri.not-set}") URI accessTokenUri,
6463
@Value("${nakadi-producer.access-token-scopes:uid}") String[] accessTokenScopes) {
6564
return new StupsTokenComponent(accessTokenUri, Arrays.asList(accessTokenScopes));
6665
}

nakadi-producer-starter-spring-boot-2-test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>org.zalando</groupId>
1212
<artifactId>nakadi-producer-reactor</artifactId>
13-
<version>20.0.0</version>
13+
<version>20.0.1</version>
1414
</parent>
1515

1616
<dependencies>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
nakadi-producer:
2-
access-token-uri: http://localhost:1234
32
nakadi-base-uri: https://nakadi.example.org:5432
43
management.endpoints.web.exposure.include: snapshot-event-creation

nakadi-producer/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>org.zalando</groupId>
1212
<artifactId>nakadi-producer-reactor</artifactId>
13-
<version>20.0.0</version>
13+
<version>20.0.1</version>
1414
</parent>
1515

1616
<artifactId>nakadi-producer</artifactId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<artifactId>nakadi-producer-reactor</artifactId>
1717
<groupId>org.zalando</groupId>
18-
<version>20.0.0</version>
18+
<version>20.0.1</version>
1919
<packaging>pom</packaging>
2020
<name>Nakadi Event Producer Reactor</name>
2121

0 commit comments

Comments
 (0)