本文整理汇总了Java中springfox.documentation.service.SecurityReference类的典型用法代码示例。如果您正苦于以下问题:Java SecurityReference类的具体用法?Java SecurityReference怎么用?Java SecurityReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityReference类属于springfox.documentation.service包,在下文中一共展示了SecurityReference类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: userApi
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
@Bean
public Docket userApi() {
AuthorizationScope[] authScopes = new AuthorizationScope[1];
authScopes[0] = new AuthorizationScopeBuilder()
.scope("read")
.description("read access")
.build();
SecurityReference securityReference = SecurityReference.builder()
.reference("test")
.scopes(authScopes)
.build();
ArrayList<SecurityContext> securityContexts = Lists.newArrayList(
SecurityContext.builder()
.securityReferences(Lists.newArrayList(securityReference))
.build()
);
return new Docket(DocumentationType.SWAGGER_2)
.directModelSubstitute(LocalDateTime.class, String.class)
.ignoredParameterTypes(User.class)
.securitySchemes(Lists.newArrayList(new BasicAuth("test")))
.securityContexts(securityContexts)
.apiInfo(apiInfo())
.select()
.paths(apiPaths())
.build();
}
开发者ID:hantsy,项目名称:angularjs-springmvc-sample-boot,代码行数:27,代码来源:SwaggerConfig.java
示例2: defaultAuth
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
List<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope
= new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
return newArrayList(
new SecurityReference("mykey", authorizationScopes));
}
开发者ID:candrews,项目名称:availability,代码行数:9,代码来源:SwaggerConfig.java
示例3: defaultAuth
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
List<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope
= new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
return newArrayList(
new SecurityReference("mykey", authorizationScopes));
}
开发者ID:saitejatokala,项目名称:SpringBoot-Swagger2,代码行数:9,代码来源:Application.java
示例4: userApi
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
@Bean
public Docket userApi() {
AuthorizationScope[] authScopes = new AuthorizationScope[1];
authScopes[0] = new AuthorizationScopeBuilder()
.scope("read")
.description("read access")
.build();
SecurityReference securityReference = SecurityReference.builder()
.reference("test")
.scopes(authScopes)
.build();
ArrayList<SecurityContext> securityContexts = newArrayList(SecurityContext.builder().securityReferences
(newArrayList(securityReference)).build());
return new Docket(DocumentationType.SWAGGER_2)
.securitySchemes(newArrayList(new BasicAuth("test")))
.securityContexts(securityContexts)
.groupName("user-api")
.apiInfo(apiInfo())
.select()
.paths(userOnlyEndpoints())
.build();
}
开发者ID:springfox,项目名称:springfox-demos,代码行数:24,代码来源:Application.java
示例5: defaultAuth
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
private List<SecurityReference> defaultAuth() {
AuthorizationScope[] authorizationScopes = new AuthorizationScope[]{
new AuthorizationScope("read", "read only"),
new AuthorizationScope("write", "read and write")
};
return Collections.singletonList(new SecurityReference("Authorization", authorizationScopes));
}
开发者ID:BakkerTom,项目名称:happy-news,代码行数:9,代码来源:SwaggerConfig.java
示例6: defaultAuth
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
List<SecurityReference> defaultAuth() {
AuthorizationScope[] authorizationScopes = new AuthorizationScope[3];
authorizationScopes[0] = new AuthorizationScope(Authority.SYS_ADMIN.name(), "System administrator");
authorizationScopes[1] = new AuthorizationScope(Authority.TENANT_ADMIN.name(), "Tenant administrator");
authorizationScopes[2] = new AuthorizationScope(Authority.CUSTOMER_USER.name(), "Customer");
return newArrayList(
new SecurityReference("X-Authorization", authorizationScopes));
}
开发者ID:osswangxining,项目名称:iotplatform,代码行数:9,代码来源:SwaggerConfiguration.java
示例7: securityContext
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
@Bean
SecurityContext securityContext() {
AuthorizationScope readScope = new AuthorizationScope("read:pets", "read your pets");
AuthorizationScope[] scopes = new AuthorizationScope[1];
scopes[0] = readScope;
SecurityReference securityReference = SecurityReference.builder()
.reference("petstore_auth")
.scopes(scopes)
.build();
return SecurityContext.builder()
.securityReferences(newArrayList(securityReference))
.forPaths(ant("/api/pet.*"))
.build();
}
开发者ID:springfox,项目名称:springfox-demos,代码行数:16,代码来源:Application.java
示例8: defaultAuth
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
List<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
return asList(
new SecurityReference("mykey", authorizationScopes));
}
开发者ID:the-james-burton,项目名称:the-turbine,代码行数:8,代码来源:SwaggerSetup.java
示例9: defaultAuth
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
List<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope
= new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
return Lists.newArrayList(
new SecurityReference("mykey", authorizationScopes));
}
开发者ID:moss0801,项目名称:apidoc,代码行数:9,代码来源:ServletConfig.java
示例10: defaultAuth
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
private List<SecurityReference> defaultAuth() {
return singletonList(SecurityReference.builder()
.scopes(new AuthorizationScope[0])
.reference(BASIC_AUTH)
.build());
}
开发者ID:MannanM,项目名称:corporate-game-share,代码行数:7,代码来源:SwaggerConfiguration.java
示例11: defaultAuth
import springfox.documentation.service.SecurityReference; //导入依赖的package包/类
List<SecurityReference> defaultAuth() {
final AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
final AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
return newArrayList(new SecurityReference("mykey", authorizationScopes));
}
开发者ID:tvajjala,项目名称:interview-preparation,代码行数:7,代码来源:ApiDocumentationConfig.java
注:本文中的springfox.documentation.service.SecurityReference类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论