Skip to content

Commit

Permalink
Fix documentation typos (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardsph authored Jul 17, 2023
1 parent 069569e commit 619bff0
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 47 deletions.
46 changes: 23 additions & 23 deletions api/src/main/java/com/inrupt/client/auth/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@
*/
/**
* <h2>Authentication and Authorization classes for the Inrupt Java Client Libraries.</h2>
*
*
* <h3>The Session interface</h3>
*
*
* <p>In the libraries we make use of the {@link Session} interface to share authentication and
* authorization information when working with HTTP clients.
*
* <p>The anonymous session, in comparison, does not keep a cache of access tokens.
*
*
* <p>The anonymous session, by contrast, does not keep a cache of access tokens.
*
* <pre>{@code
SolidClient client = SolidClient.getClient().session(Session.anonymous());
* }</pre>
*
* <p>The session is also used in the authentication/authorization modules and help create a dedicated session
*
* <p>The session is also used in the authentication/authorization modules and helps create a dedicated session
* for each implementation. Some examples:
*
*
* <pre>{@code
Session openidSession = OpenIdSession.ofIdToken(token);
Session openidSessionWithConfig = OpenIdSession.ofIdToken(token, config);
Session accessGrantSession = AccessGrantSession.ofAccessGrant(openidSession, accessGrant);
* }</pre>
*
*
* <h3>HTTP challenges</h3>
*
*
* <p>As part of the HTTP Challenge and Response authentication framework, the {@link Challenge} class represents a
* challenge object as represented in a WWW-Authenticate Response Header. An example code is shown next.
*
*
* <pre>{@code
List<Challenge> challenges = WwwAuthenticate.parse(response.headers()
.firstValue("WWW-Authenticate").get()).getChallenges();
Expand All @@ -55,11 +55,11 @@
+ challenges.get(0).getParameter("realm"));
System.out.println("Authorization server: " + challenges.get(0).getParameter("as_uri");
* }</pre>
*
*
* <h3>Client credentials</h3>
*
*
* <p>We make use of the {@link Credential} class when working with OIDC ID Tokens. Example code is presented next.
*
*
* <pre>{@code
Credential token = new Credential("Bearer", URI.create(ISS), this.token,
Instant.now().plusSeconds(3600), URI.create(WEBID), null);
Expand All @@ -70,11 +70,11 @@
Session session = OpenIdSession.ofIdToken(token, config);
System.out.println("The token is an OpenID token " + session.getCredential(OpenIdSession.ID_TOKEN).isPresent());
* }</pre>
*
*
* <h3>Authentication</h3>
*
* <p>The {@link Authenticator} is the interface to call if one wants to develop an own authentication logic.
*
*
* <p>The {@link Authenticator} is the interface to call if you want to develop your own authentication logic.
*
* <pre>{@code
class TestAuthenticator implements Authenticator {
{@literal @}Override
Expand All @@ -94,12 +94,12 @@ public CompletionStage<Credential> authenticate(Session session,
}
}
* }</pre>
*
* <p>If one want to make use of DPoP, the {@link DPoP} interface makes available the basic
* methods for generating a proof or creating a DPoP manager for example.
*
*
* <p>If you want to make use of DPoP, the {@link DPoP} interface makes available the basic
* methods for generating a proof or creating a DPoP manager, for example.
*
* <p>{@link ReactiveAuthorization} is the class which will negotiate for a token based on the WWW-Authenticate header
* and the Authenticator loaded on the classpath.
*
*
*/
package com.inrupt.client.auth;
4 changes: 2 additions & 2 deletions api/src/main/java/com/inrupt/client/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
* some of the higher-level modules.
*
* <p>Working with an HTTP client is easier by implementing the {@link Client}. Then, to make use of the HTTP client,
* which previously was loaded on the classpath, one can call the {@link ClientProvider}.
* which previously was loaded on the classpath, you can call the {@link ClientProvider}.
*
* <p>{@link Request} and {@link Response} classes help with interacting with an HTTP client. And {@link Headers}
* helps parsing header values, including those often used with Solid, such as {@link Headers.Link}
* or {@link Headers.WacAllow}.
*
* <p>Further, to work with HTTP resources as RDF-based resources, one can make use of the {@link Resource}
* <p>Further, to work with HTTP resources as RDF-based resources, you can make use of the {@link Resource}
* class.
* {@link ValidationResult} can be of use when validation of the Solid resource is needed.
*
Expand Down
2 changes: 1 addition & 1 deletion integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ They can be found in the `./base/src/main/resources/META-INF/microprofile-config

## Running the tests on a live Solid server

To set up a server, one needs to add more configurations to the `./base/src/main/resources/META-INF/microprofile-config.properties` file.
To set up a server, you needs to add more configurations to the `./base/src/main/resources/META-INF/microprofile-config.properties` file.

Let's take a look at the possible configuration values in the properties file.
All the possible value are listed next:
Expand Down
12 changes: 6 additions & 6 deletions solid/src/main/java/com/inrupt/client/solid/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
*
* <h3>Solid Client</h3>
*
* <p>This Solid domain-specific module contains two dedicated Solid clients one can make use of:
* <p>This Solid domain-specific module contains two dedicated Solid clients you can make use of:
* {@link SolidClient} which works asynchronously and {@link SolidSyncClient} which works synchronously.
*
*
* <p>One can instantiate a Solid client in different ways, depending on the use case:
*
*
* <p>A simple direct way is with the following line:
* <pre>{@code
SolidClient client = SolidClient.getClient();
Expand All @@ -44,9 +44,9 @@
SolidClient client = SolidClient.getClientBuilder().client(classPathClient).build();
}
* </pre>
*
*
* <p>The Solid client can be used to perform CRUD operations on Solid resources.
*
*
* <p>In this example, the client reads a Solid resource as a {@code Playlist} object.
* <pre>{@code
var playlist = client.read(uri, Playlist.class);
Expand Down Expand Up @@ -82,7 +82,7 @@
* <pre>{@code
client.delete(uri).toCompletableFuture().join(); }
* </pre>
*
*
* <h3>Solid RDFSource and Solid Container</h3>
*
* <p>This module also contains a BodyHandler which consumes the response body
Expand Down
4 changes: 2 additions & 2 deletions src/site/apt/client-options.apt.vm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Client Options

An application can obtain a client for interacting with Solid data in several ways. This guide will help you decide how your application will retrieve, configure and use a client.

* What you will need
Expand Down Expand Up @@ -133,7 +133,7 @@ public class ClientSample {

* <<<Response.BodyHandlers.ofInputStream()>>> This handler maps the HTTP response to an <<<InputStream>>>. This may be useful for custom processing of the response body.

* <<<Response.BodyHandlers.ofString()>>> This handler maps the HTTP response to a <<<String>>>. This may be useful for small text-oriented responses, though one should generally prefer the <<<InputStream>>>-based API.
* <<<Response.BodyHandlers.ofString()>>> This handler maps the HTTP response to a <<<String>>>. This may be useful for small text-oriented responses, though the <<<InputStream>>>-based API is generally preferred.


When working with RDF resources, there are Jena and RDF4J handlers that will map HTTP responses directly to a Jena or RDF4J Model. These handlers are useful in cases where applications are already using an RDF framework. <<<JenaBodyHandlers.ofModel()>>> or <<<RDF4JBodyHandlers.ofModel()>>> would be used in these cases.
Expand Down
6 changes: 3 additions & 3 deletions src/site/apt/data-modeling.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Data Modeling
* How to complete

At first you need to know (or choose) how your data is modeled on the Solid Pod.
Than one can model your data wite the available domain-specific types of with the class wrapper.
Then you can model your data with the available domain-specific types of with the class wrapper.

* Different data model approaches

Let's work with an example to describe the data model options.
Let's work with an example to describe the data model options.

We want to model a Book Library on the Pod:

* One Solid Resource - we have a Book Library Solid Resource which contains all the book descriptions part of that library it one Solid Resource or
* One Solid Resource - we have a Book Library Solid Resource which contains all the book descriptions part of that library in one Solid Resource or

* Multiple Solid Resources - we have a Book Library Solid Container which holds more Solid Resources. Each Resource, in turn, contains the description of only one Book.

8 changes: 4 additions & 4 deletions src/site/apt/data-modeling/multiple-resources.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Data Modeling for multiple Solid Resources

* How to complete

The solution involves working with domain-specific type such as <<<SolidContainer>>> and <<<SolidResource>>>.
The solution involves working with domain-specific type such as <<<SolidContainer>>> and <<<SolidResource>>>.

* Working with Solid Containers

Given a Solid Container, we assume that all Solid RDF Resources contained in the container are Books. One Book per Solid Resource.
Given a Solid Container, we assume that all Solid RDF Resources contained in the container are Books. One Book per Solid Resource.

For modeling a single Book one can use a <<<SolidResource>>> or a wrapper class as (describe on the {{{./one-resource.html}one Solid Resource}} page).
For modeling a single Book you can use a <<<SolidResource>>> or a wrapper class as (describe on the {{{./one-resource.html}one Solid Resource}} page).

+---
import com.inrupt.client.auth.Session;
Expand Down Expand Up @@ -48,7 +48,7 @@ public class MyApplication {
}
});
}

}
}
+---
Expand Down
12 changes: 6 additions & 6 deletions src/site/apt/sessions/session-access-grants.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ Access Grants
{{{https://docs.inrupt.com/ess/latest/security/access-requests-grants/}Access Grants}} provide an alternative way to give access to your Solid resources. The Inrupt Java Client Libraries
provide tooling for working with Access Grants.

To use {{{https://docs.inrupt.com/ess/latest/security/access-requests-grants/}Access Grants}}, the resources one wants to access must have an {{{https://docs.inrupt.com/ess/latest/security/access-requests-grants/#access-grants-acp}access control policy (ACP) that enables the use of access grants}} and the Authorization Service must be able to exchange an access grant for a token (for example such as a {{{https://docs.inrupt.com/ess/latest/services/service-uma/}UMA Service}}).
To use {{{https://docs.inrupt.com/ess/latest/security/access-requests-grants/}Access Grants}}, the resources you want to access must have an {{{https://docs.inrupt.com/ess/latest/security/access-requests-grants/#access-grants-acp}access control policy (ACP) that enables the use of access grants}} and the Authorization Service must be able to exchange an access grant for a token (for example such as a {{{https://docs.inrupt.com/ess/latest/services/service-uma/}UMA Service}}).

* ACP that enables the use of Access Grants

One needs to edit the ACP of the resource the access grant will be used for.
One needs to edit the ACP of the resource the access grant will be used for.

** Manually adding triples to ACP

This can be done manually by using a resource management interface such as {{{https://podpro.dev/} Pod Pro}}.

The next example contains a new access control that matches <<<http://www.w3.org/ns/solid/vc#SolidAccessGrant>>>> and allows Read and Write access to a Solid Container and its contents.
The next example contains a new access control that matches <<<http://www.w3.org/ns/solid/vc#SolidAccessGrant>>>> and allows Read and Write access to a Solid Container and its contents.

+---
prefix acp: <http://www.w3.org/ns/solid/acp#>
Expand Down Expand Up @@ -119,7 +119,7 @@ if (acrLink != null) {
//adding the new access control to the ACP
resource.add(rdf.createQuad(resourceACRiri, resourceACRiri, acpAccessControl, newAccessControl));
authClient.update(resource);

}
}
+---
Expand Down

0 comments on commit 619bff0

Please sign in to comment.