当前位置: 首页>>代码示例>>Java>>正文


Java AuthorizationScope类代码示例

本文整理汇总了Java中springfox.documentation.service.AuthorizationScope的典型用法代码示例。如果您正苦于以下问题:Java AuthorizationScope类的具体用法?Java AuthorizationScope怎么用?Java AuthorizationScope使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AuthorizationScope类属于springfox.documentation.service包,在下文中一共展示了AuthorizationScope类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: userApi

import springfox.documentation.service.AuthorizationScope; //导入依赖的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.AuthorizationScope; //导入依赖的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.AuthorizationScope; //导入依赖的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.AuthorizationScope; //导入依赖的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.AuthorizationScope; //导入依赖的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: oAuth

import springfox.documentation.service.AuthorizationScope; //导入依赖的package包/类
private List<SecurityScheme> oAuth() {
    // browser
    List<AuthorizationScope> scopes1 = new ArrayList<AuthorizationScope>();
    scopes1.add(new AuthorizationScope("ui", "browser"));

    List<GrantType> gTypes1 = new ArrayList<GrantType>();
    //gTypes1.add(new GrantType("refresh_token"));
    gTypes1.add(new ResourceOwnerPasswordCredentialsGrant(oauthServerUri));

    OAuth oAuth1 = new OAuth("browser", scopes1, gTypes1);

    // Server
    List<AuthorizationScope> scopes2 = new ArrayList<AuthorizationScope>();
    scopes2.add(new AuthorizationScope("server", "server"));

    List<GrantType> gTypes2 = new ArrayList<GrantType>();
    gTypes2.add(new ClientCredentialsGrant(oauthServerUri));
    //gTypes2.add(new GrantType("refresh_token"));

    OAuth oAuth2 = new OAuth("account-service", scopes2, gTypes2);

    List<SecurityScheme> list = new ArrayList<SecurityScheme>();
    list.add(oAuth1);
    list.add(oAuth2);

    return list;
}
 
开发者ID:sniperqpc,项目名称:Spring-cloud-gather,代码行数:28,代码来源:SwaggerConfiguration.java

示例7: scopes

import springfox.documentation.service.AuthorizationScope; //导入依赖的package包/类
private List<AuthorizationScope> scopes() {
List<AuthorizationScope> list = new ArrayList();
list.add(new AuthorizationScope("read_scope","Grants read access"));
list.add(new AuthorizationScope("write_scope","Grants write access"));
list.add(new AuthorizationScope("admin_scope","Grants read write and delete access"));
return list;
  }
 
开发者ID:springfox,项目名称:springfox-oath2-demo,代码行数:8,代码来源:SwaggerConfig.java

示例8: defaultAuth

import springfox.documentation.service.AuthorizationScope; //导入依赖的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

示例9: securityContext

import springfox.documentation.service.AuthorizationScope; //导入依赖的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

示例10: defaultAuth

import springfox.documentation.service.AuthorizationScope; //导入依赖的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

示例11: defaultAuth

import springfox.documentation.service.AuthorizationScope; //导入依赖的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

示例12: defaultAuth

import springfox.documentation.service.AuthorizationScope; //导入依赖的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

示例13: defaultAuth

import springfox.documentation.service.AuthorizationScope; //导入依赖的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

示例14: scopes

import springfox.documentation.service.AuthorizationScope; //导入依赖的package包/类
List<AuthorizationScope> scopes() {
    return newArrayList(
            new AuthorizationScope("write:pets", "modify pets in your account"),
            new AuthorizationScope("read:pets", "read your pets"));
}
 
开发者ID:springfox,项目名称:springfox-demos,代码行数:6,代码来源:Application.java


注:本文中的springfox.documentation.service.AuthorizationScope类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。