GUACAMOLE-289: Clarify behavior of getResource() with respect to authenticated vs. unauthenticated.

This commit is contained in:
Michael Jumper
2017-04-29 14:00:10 -07:00
parent aa261410f4
commit 8142b2d5f8
2 changed files with 21 additions and 17 deletions

View File

@@ -41,15 +41,17 @@ public interface AuthenticationProvider {
String getIdentifier(); String getIdentifier();
/** /**
* Returns an arbitrary REST resource. The REST resource returned must be * Returns an arbitrary REST resource representing this
* properly annotated with JSR-311 annotations, and may serve as the root * AuthenticationProvider. The REST resource returned must be properly
* resource for any number of extension-specific REST resources which are * annotated with JSR-311 annotations, and may serve as the root resource
* unrelated to an authenticated user's session. The returned resource is * for any number of subresources. The returned resource is ultimately
* ultimately exposed at ".../api/ext/IDENTIFIER/", where IDENTIFIER is the * exposed at ".../api/ext/IDENTIFIER/", where IDENTIFIER is the identifier
* identifier of the AuthenticationProvider. * of this AuthenticationProvider.
* *
* REST resources which ARE related to an authenticated user's session * REST resources returned by this function will be reachable by all users,
* should instead be returned from UserContext.getResource(). * regardless of whether they have authenticated. REST resources which
* must only be accessible by authenticated users should instead be returned
* from UserContext.getResource().
* *
* @return * @return
* An arbitrary REST resource, annotated with JSR-311 annotations, or * An arbitrary REST resource, annotated with JSR-311 annotations, or

View File

@@ -39,16 +39,18 @@ public interface UserContext {
User self(); User self();
/** /**
* Returns an arbitrary REST resource. The REST resource returned must be * Returns an arbitrary REST resource representing this UserContext. The
* properly annotated with JSR-311 annotations, and may serve as the root * REST resource returned must be properly annotated with JSR-311
* resource for any number of extension-specific REST resources related to * annotations, and may serve as the root resource for any number of
* an authenticated user's session. The returned resource is ultimately * subresources. The returned resource is ultimately exposed at
* exposed at ".../api/session/ext/IDENTIFIER/", where IDENTIFIER is the * ".../api/session/ext/IDENTIFIER/", where IDENTIFIER is the identifier of
* identifier of the AuthenticationProvider associated with this * the AuthenticationProvider associated with this UserContext.
* UserContext.
* *
* REST resources which are NOT related to an authenticated user's session * REST resources returned by this function will only be reachable by
* should instead be returned from AuthenticationProvider.getResource(). * authenticated users with valid authentication tokens. REST resources
* which should be accessible by all users regardless of whether they have
* authenticated should instead be returned from
* AuthenticationProvider.getResource().
* *
* @return * @return
* An arbitrary REST resource, annotated with JSR-311 annotations, or * An arbitrary REST resource, annotated with JSR-311 annotations, or