FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

JCL-328: Deprecate UmaSession by acoburn · Pull Request #411 · inrupt/solid-client-java · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (5) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
* for each implementation. Some examples:
*
* <pre>{@code
Session session = OpenIdSession.ofIdToken(token);
Session sessionWithConfig = OpenIdSession.ofIdToken(token, config);
Session umaSession = UmaSession.of(session);
Session openidSession = OpenIdSession.ofIdToken(token);
Session openidSessionWithConfig = OpenIdSession.ofIdToken(token, config);
Session accessGrantSession = AccessGrantSession.ofAccessGrant(openidSession, accessGrant);
* }</pre>
*
* <h3>HTTP challenges</h3>
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
.POST(Request.BodyPublishers.ofString("Test String 1"))
.build();

Response<Void> response = client.session(UmaSession.of(s))
Response<Void> response = client
.send(request, Response.BodyHandlers.discarding())
.toCompletableFuture().join();
* }</pre>
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import com.inrupt.client.jena.JenaBodyPublishers;
import com.inrupt.client.openid.OpenIdConfig;
import com.inrupt.client.openid.OpenIdSession;
import com.inrupt.client.uma.UmaSession;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -206,10 +205,10 @@ void testOfModelPublisherBearer() throws IOException, InterruptedException {
claims.put("azp", AZP);
claims.put("cnf", Collections.singletonMap("jkt", ecJwk.calculateBase64urlEncodedThumbprint(SHA_256)));
final String token = generateIdToken(claims);
final Session session = UmaSession.of(OpenIdSession.ofIdToken(token, config));
final Session session = OpenIdSession.ofIdToken(token, config);
assertEquals(Optional.of(URI.create(WEBID)), session.getPrincipal());

final Session session2 = UmaSession.of();
final Session session2 = Session.anonymous();
assertFalse(session2.getPrincipal().isPresent());
assertNotEquals(session2.getId(), session.getId());
assertFalse(session2.generateProof(null, null).isPresent());
Expand Down Expand Up @@ -327,7 +326,7 @@ void testPutRDF() throws Exception {
}

@Test
void testOfStringPublisherUmaSession() throws IOException, InterruptedException {
void testOfStringPublisherOpenidSession() throws IOException, InterruptedException {
final Map<String, Object> claims = new HashMap<>();
claims.put("webid", WEBID);
claims.put("sub", SUB);
Expand All @@ -346,7 +345,7 @@ void testOfStringPublisherUmaSession() throws IOException, InterruptedException
config.setProofKeyPairs(Collections.singletonMap("RS256",
new KeyPair(jwk.getPublicKey(), jwk.getPrivateKey())));

final Response<Void> response = client.session(UmaSession.of(OpenIdSession.ofIdToken(token, config)))
final Response<Void> response = client.session(OpenIdSession.ofIdToken(token, config))
.send(request, Response.BodyHandlers.discarding())
.toCompletableFuture().join();

Expand All @@ -361,7 +360,7 @@ void testOfStringPublisherUmaAnonSession() throws IOException, InterruptedExcept
.POST(Request.BodyPublishers.ofString("Test String 1"))
.build();

final Response<Void> response = client.session(UmaSession.of())
final Response<Void> response = client.session(Session.anonymous())
.send(request, Response.BodyHandlers.discarding())
.toCompletableFuture().join();

Expand All @@ -375,7 +374,7 @@ void testNullSession() {
}

@Test
void testUmaSessionExpiredIdToken() throws Exception {
void testSessionExpiredIdToken() throws Exception {
final Map<String, Object> claims = new HashMap<>();
claims.put("webid", WEBID);
claims.put("sub", SUB);
Expand All @@ -398,7 +397,7 @@ void testUmaSessionExpiredIdToken() throws Exception {
.POST(Request.BodyPublishers.ofString("Test String 1"))
.build();

final Response<Void> response = client.session(UmaSession.of(s))
final Response<Void> response = client.session(s)
.send(request, Response.BodyHandlers.discarding())
.toCompletableFuture().join();

Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@

/**
* A session implementation for use with UMA Authorization Servers.
*
* @deprecated As of Beta3, this class is deprecated
*/
@Deprecated
public final class UmaSession implements Session {

private final String id;
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,10 @@
*
* <p>UMA builds on the OAuth 2.0 authorization framework, defining a mechanism by which
* a client can iteratively negotiate for an access token.
*
*
* <p>{@code UmaClient} helps in the interaction with different endpoints, to construct helper
* requests for authentication and to negotiate for a token.
*
* <h3>Using a UMA session</h3>
*
* <p>This module has a session implementation, {@code UmaSession}, for use with UMA Authorization Servers.
*
* <p>This session implementation can be used to wrap other session objects, such as
* ones that use OpenID Connect tokens.
*
* <pre>{@code
* Client client = ClientProvider.getClient();
* Session session = client.session(UmaSession.ofSession(OpenIdSession.ofIdToken(jwt)));
* Response res = session.send(req, bodyHandler);
* }</pre>
*
* <h3>Discovering the UMA configuration</h3>
*
* <pre>{@code
Expand Down

Back | FazBrowse Home | New Git URL