org.zalando.stups:tokens-spring-boot-starter-parent

OAuth2-Tokens Library - Build-Parent

License

License

Categories

Categories

Spring Boot Container Microservices
GroupId

GroupId

org.zalando.stups
ArtifactId

ArtifactId

tokens-spring-boot-starter-parent
Last Version

Last Version

0.13.0
Release Date

Release Date

Type

Type

pom
Description

Description

OAuth2-Tokens Library - Build-Parent
Project Organization

Project Organization

Zalando SE
Source Code Management

Source Code Management

https://github.com/zalando-stups/spring-boot-zalando-stups-tokens

Download tokens-spring-boot-starter-parent

How to add to project

<!-- https://jarcasting.com/artifacts/org.zalando.stups/tokens-spring-boot-starter-parent/ -->
<dependency>
    <groupId>org.zalando.stups</groupId>
    <artifactId>tokens-spring-boot-starter-parent</artifactId>
    <version>0.13.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/org.zalando.stups/tokens-spring-boot-starter-parent/
implementation 'org.zalando.stups:tokens-spring-boot-starter-parent:0.13.0'
// https://jarcasting.com/artifacts/org.zalando.stups/tokens-spring-boot-starter-parent/
implementation ("org.zalando.stups:tokens-spring-boot-starter-parent:0.13.0")
'org.zalando.stups:tokens-spring-boot-starter-parent:pom:0.13.0'
<dependency org="org.zalando.stups" name="tokens-spring-boot-starter-parent" rev="0.13.0">
  <artifact name="tokens-spring-boot-starter-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='org.zalando.stups', module='tokens-spring-boot-starter-parent', version='0.13.0')
)
libraryDependencies += "org.zalando.stups" % "tokens-spring-boot-starter-parent" % "0.13.0"
[org.zalando.stups/tokens-spring-boot-starter-parent "0.13.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • k8s-node-detector
  • tokens-spring-boot-starter

Build Status Maven Central codecov.io

Tokens Support for Spring-Boot apps

Is a small wrapper around Tokens with lifecycle-management and autoconfiguration-support in Spring-Boot applications.

With this in place you can use the 'AccessTokens' anywhere in your application (@Autowire directly or in a configuration class), use it directly or inject it into some 'TokenProvider'-implementations that delegate somehow.

Install

Maven

Add the following to your pom.xml:

    <dependency>
        <groupId>org.zalando.stups</groupId>
        <artifactId>tokens-spring-boot-starter</artifactId>
        <version>${version}</version>
    </dependency>

Gradle

Add the following to your build.gradle:

compile('org.zalando.stups:tokens-spring-boot-starter:${version}')

Usage in Zalandos K8s environment (with PlatformCredentialsSet)

Only put the dependency into your pom.xml. It uses /meta/credentials as a default folder to look for provided tokens by PlatformCredentialsSet.

Want to migrate from STUPS to K8s? See the hints.

Usage in Zalandos STUPS environment

    tokens:
        accessTokenUri: http://localhost:9191/access_token?realm=whatever
    
        token-configuration-list:
            - tokenId: firstService
              scopes:
                  - read
                  - write
                  - all
            - tokenId: secondService
              scopes: all

Migration from Zalandos STUPS env to Zalandos K8s env

Please make sure the credentials are mounted as shown in the example below.

...
          volumeMounts:
          - name: "{{ APPLICATION }}-credentials"
            mountPath: /meta/credentials
            readOnly: true
      volumes:
        - name: "{{ APPLICATION }}-credentials"
          secret:
            secretName: "{{ APPLICATION }}-credentials"

Please also make sure that token identifiers/names must equal the respective items in credentials.yaml:

apiVersion: "zalando.org/v1"
kind: PlatformCredentialsSet
metadata:
   name: "{{ APPLICATION }}-credentials"
spec:
   application: "{{ APPLICATION }}"
   tokens:
     firstService:
       privileges:
         - com.zalando::read
         - com.zalando::write
         - com.zalando::all
     secondService:
       privileges:
         - com.zalando::all

Build

./mvnw install

License

Copyright © 2015 Zalando SE

Licensed 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.

org.zalando.stups

STUPS by Zalando

THE PROJECTS IN THIS ORG ARE NO LONGER ACTIVELY MAINTAINED

Versions

Version
0.13.0
0.12.0
0.12.0-beta-1
0.11.0-beta-7
0.11.0-beta-6
0.11.0-beta-5
0.11.0-beta-4
0.11.0-beta-3
0.11.0-beta-2
0.11.0-beta-1
0.10.1-GH-13
0.10.0