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

Uaa token provider #948

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* 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.
*/

package org.cloudfoundry.reactor;

import reactor.core.publisher.Mono;

/**
* Extends {@link TokenProvider} to add UAA-specific functionality.
*/
public interface UaaTokenProvider extends TokenProvider {

/**
* Returns a {@link Flux} of refresh tokens for a connection
*
* @param connectionContext A {@link ConnectionContext} to be used to identity which connection the refresh tokens be retrieved for
* @return a {@link Flux} that emits the last token on subscribe and new refresh tokens as they are negotiated
*/
Flux<String> getRefreshTokens(ConnectionContext connectionContext);

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
/**
* An abstract base class for all token providers that interact with the UAA. It encapsulates the logic to refresh the token before expiration.
*/
public abstract class AbstractUaaTokenProvider implements TokenProvider {
public abstract class AbstractUaaTokenProvider implements UaaTokenProvider {

private static final Logger LOGGER = LoggerFactory.getLogger("cloudfoundry-client.token");

Expand Down Expand Up @@ -99,6 +99,7 @@ public String getClientSecret() {
* @param connectionContext A {@link ConnectionContext} to be used to identity which connection the refresh tokens be retrieved for
* @return a {@link Flux} that emits the last token on subscribe and new refresh tokens as they are negotiated
*/
@Override
public Flux<String> getRefreshTokens(ConnectionContext connectionContext) {
return getRefreshTokenStream(connectionContext).processor;
}
Expand Down