private SecuritySchemeDefinition getSecuritySchemeDefinitionByType(String type, JsonNode node) throws GenerateException { try { SecuritySchemeDefinition def = null; if (type.equals(new OAuth2Definition().getType())) { def = new OAuth2Definition(); if (node != null) { def = mapper.readValue(node.traverse(), OAuth2Definition.class); } } else if (type.equals(new BasicAuthDefinition().getType())) { def = new BasicAuthDefinition(); if (node != null) { def = mapper.readValue(node.traverse(), BasicAuthDefinition.class); } } else if (type.equals(new ApiKeyAuthDefinition().getType())) { def = new ApiKeyAuthDefinition(); if (node != null) { def = mapper.readValue(node.traverse(), ApiKeyAuthDefinition.class); } } return def; } catch (IOException e) { throw new GenerateException(e); } }
public static OAuth2Definition oAuth2() { return new OAuth2Definition(); } public static ExternalDocs externalDocs() {
OAuth2Definition oAuth2Definition = new OAuth2Definition(); oAuth2Definition.setType("oauth2"); oAuth2Definition.setFlow("password");
OAuth2Definition oAuth2Definition = new OAuth2Definition(); oAuth2Definition.setType("oauth2"); oAuth2Definition.setFlow("password");
private void addSecuritySchemeToSwaggerDefinition(Swagger swagger, API api) { KeyMgtConfigurations keyMgtConfigurations = ServiceReferenceHolder.getInstance(). getAPIMConfiguration().getKeyManagerConfigs(); if ((api.getSecurityScheme() & 2) == 2) { //apikey log.debug("API security scheme : API Key Scheme"); if (swagger.getSecurityDefinitions() == null || !swagger.getSecurityDefinitions().containsKey (APIMgtConstants.SWAGGER_APIKEY)) { swagger.securityDefinition(APIMgtConstants.SWAGGER_APIKEY, new ApiKeyAuthDefinition( APIMgtConstants.SWAGGER_APIKEY, In.HEADER)); } } if ((api.getSecurityScheme() & 1) == 1) { log.debug("API security Scheme : Oauth"); OAuth2Definition oAuth2Definition = new OAuth2Definition(); oAuth2Definition = oAuth2Definition.application(keyMgtConfigurations.getTokenEndpoint()); oAuth2Definition.setScopes(Collections.emptyMap()); if (swagger.getSecurityDefinitions() == null || !swagger.getSecurityDefinitions().containsKey (APIMgtConstants.OAUTH2SECURITY)) { swagger.securityDefinition(APIMgtConstants.OAUTH2SECURITY, oAuth2Definition); } } }
private void addSecuritySchemeToSwaggerDefinition(Swagger swagger, API api) { KeyMgtConfigurations keyMgtConfigurations = ServiceReferenceHolder.getInstance(). getAPIMConfiguration().getKeyManagerConfigs(); if ((api.getSecurityScheme() & 2) == 2) { //apikey log.debug("API security scheme : API Key Scheme"); if (swagger.getSecurityDefinitions() == null || !swagger.getSecurityDefinitions().containsKey (APIMgtConstants.SWAGGER_APIKEY)) { swagger.securityDefinition(APIMgtConstants.SWAGGER_APIKEY, new ApiKeyAuthDefinition( APIMgtConstants.SWAGGER_APIKEY, In.HEADER)); } } if ((api.getSecurityScheme() & 1) == 1) { log.debug("API security Scheme : Oauth"); OAuth2Definition oAuth2Definition = new OAuth2Definition(); oAuth2Definition = oAuth2Definition.application(keyMgtConfigurations.getTokenEndpoint()); oAuth2Definition.setScopes(Collections.emptyMap()); if (swagger.getSecurityDefinitions() == null || !swagger.getSecurityDefinitions().containsKey (APIMgtConstants.OAUTH2SECURITY)) { swagger.securityDefinition(APIMgtConstants.OAUTH2SECURITY, oAuth2Definition); } } }
OAuth2Definition oAuth2Definition = new OAuth2Definition();
switch (_type) { case OAUTH2: final OAuth2Definition result = new OAuth2Definition(); this.setVendorExtensions(scheme, result); String _switchResult_1 = null;
OAuth2Definition oauth2 = new OAuth2Definition() .implicit(ig.getLoginEndpoint().getUrl()); if (swagger.getSecurityDefinitions() != null && swagger.getSecurityDefinitions().keySet().contains(authNickname)) { OAuth2Definition oauth2 = new OAuth2Definition() .accessCode(ac.getTokenRequestEndpoint().getUrl(), ac.getTokenEndpoint().getUrl()); if (swagger.getSecurityDefinitions() != null && swagger.getSecurityDefinitions().keySet().contains(authNickname)) {
io.swagger.models.auth.OAuth2Definition oAuth2Definition = new io.swagger.models.auth.OAuth2Definition(); OAuth2Definition.Flow flow = oAuth2Config.flow();
io.swagger.models.auth.OAuth2Definition oAuth2Definition = new io.swagger.models.auth.OAuth2Definition(); OAuth2Definition.Flow flow = oAuth2Config.flow();
io.swagger.models.auth.OAuth2Definition oAuth2Definition = new io.swagger.models.auth.OAuth2Definition(); OAuth2Definition.Flow flow = oAuth2Config.flow();
io.swagger.models.auth.OAuth2Definition oAuth2Definition = new io.swagger.models.auth.OAuth2Definition(); OAuth2Definition.Flow flow = oAuth2Config.flow();