use of org.eclipse.microprofile.openapi.models.security.OAuthFlow 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;
}
Aggregations