use of org.wildfly.swarm.microprofile.openapi.api.models.security.OAuthFlowImpl in project wildfly-swarm by wildfly-swarm.
the class OpenApiAnnotationScanner method readOAuthFlow.
/**
* Reads a single OAuthFlow annotation into a model.
* @param value
*/
private OAuthFlow readOAuthFlow(AnnotationValue value) {
if (value == null) {
return null;
}
LOG.debug("Processing a single @OAuthFlow annotation.");
AnnotationInstance annotation = value.asNested();
OAuthFlow flow = new OAuthFlowImpl();
flow.setAuthorizationUrl(JandexUtil.stringValue(annotation, OpenApiConstants.PROP_AUTHORIZATION_URL));
flow.setTokenUrl(JandexUtil.stringValue(annotation, OpenApiConstants.PROP_TOKEN_URL));
flow.setRefreshUrl(JandexUtil.stringValue(annotation, OpenApiConstants.PROP_REFRESH_URL));
flow.setScopes(readOAuthScopes(annotation.value(OpenApiConstants.PROP_SCOPES)));
return flow;
}
use of org.wildfly.swarm.microprofile.openapi.api.models.security.OAuthFlowImpl in project wildfly-swarm by wildfly-swarm.
the class OpenApiParser method readOAuthFlow.
/**
* Reads a {@link OAuthFlow} OpenAPI node.
* @param node
*/
private OAuthFlow readOAuthFlow(JsonNode node) {
if (node == null || !node.isObject()) {
return null;
}
OAuthFlowImpl model = new OAuthFlowImpl();
model.setAuthorizationUrl(JsonUtil.stringProperty(node, OpenApiConstants.PROP_AUTHORIZATION_URL));
model.setTokenUrl(JsonUtil.stringProperty(node, OpenApiConstants.PROP_TOKEN_URL));
model.setRefreshUrl(JsonUtil.stringProperty(node, OpenApiConstants.PROP_REFRESH_URL));
model.setScopes(readScopes(node.get(OpenApiConstants.PROP_SCOPES)));
readExtensions(node, model);
return model;
}
Aggregations