Fix build after COMMONS-122 Remove set backing-implementation of JsonValue
| | |
| | | final JsonValue firstItem = value.get(value.keys().iterator().next()); |
| | | // assume all items have the same schema |
| | | jsonSchema.put("items", toJsonSchema(firstItem)); |
| | | if (value.isSet()) { |
| | | if (value.getObject() instanceof Set) { |
| | | jsonSchema.put("uniqueItems", true); |
| | | } |
| | | return jsonSchema; |
| | |
| | | * |
| | | * Copyright 2015-2016 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.rest2ldap; |
| | | |
| | | import static org.forgerock.http.handler.Handlers.chainOf; |
| | |
| | | @VisibleForTesting |
| | | ConditionalFilter buildOAuth2Filter(final JsonValue config) throws HttpApplicationException { |
| | | final String realm = config.get(REALM).defaultTo("no_realm").asString(); |
| | | final Set<String> scopes = config.get(SCOPES).required().asSet(String.class); |
| | | final Set<String> scopes = config.get(SCOPES).required().as(setOf(String.class)); |
| | | final AccessTokenResolver resolver = |
| | | createCachedTokenResolverIfNeeded(config, parseUnderlyingResolver(config)); |
| | | final String resolverName = config.get(RESOLVER_CONFIG_OBJECT).asString(); |
| | |
| | | package org.forgerock.opendj.rest2ldap.authz; |
| | | |
| | | import static org.forgerock.opendj.rest2ldap.Rest2ldapMessages.*; |
| | | import static org.forgerock.json.JsonValueFunctions.*; |
| | | import static org.forgerock.opendj.ldap.requests.Requests.newSingleEntrySearchRequest; |
| | | import static org.forgerock.opendj.rest2ldap.authz.Utils.close; |
| | | import static org.forgerock.opendj.rest2ldap.authz.Utils.newAccessTokenException; |
| | |
| | | } |
| | | |
| | | return new AccessTokenInfo(accessToken, token, |
| | | accessToken.get("scope").required().asSet(String.class), |
| | | accessToken.get("scope").required().as(setOf(String.class)), |
| | | Long.parseLong(getRequiredFirstValue(accessToken.get("expireTime")))); |
| | | } |
| | | }, new Function<LdapException, AccessTokenInfo, AccessTokenException>() { |
| | |
| | | */ |
| | | package org.forgerock.opendj.rest2ldap.authz; |
| | | |
| | | import static org.forgerock.json.JsonValueFunctions.*; |
| | | import static org.forgerock.opendj.rest2ldap.Rest2ldapMessages.*; |
| | | import static org.forgerock.opendj.rest2ldap.authz.Utils.newAccessTokenException; |
| | | import static org.forgerock.util.Reject.checkNotNull; |
| | |
| | | |
| | | try { |
| | | final AccessTokenInfo result = new AccessTokenInfo(accessToken, token, |
| | | accessToken.get("scope").required().asSet(String.class), |
| | | accessToken.get("scope").required().as(setOf(String.class)), |
| | | accessToken.get("expireTime").required().asLong()); |
| | | return newResultPromise(result); |
| | | } catch (final JsonValueException e) { |