org.raml.model.Action.getSecuredBy()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.raml.model.Action.getSecuredBy()方法的一些代码示例,展示了Action.getSecuredBy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Action.getSecuredBy()方法的具体详情如下:
包路径:org.raml.model.Action
类名称:Action
方法名:getSecuredBy

Action.getSecuredBy介绍

暂无

代码示例

代码示例来源:origin: nidi3/raml-tester

public List<SecurityScheme> securedBy(Action action) {
  final List<SecurityScheme> res = new ArrayList<>();
  if (!action.getSecuredBy().isEmpty()) {
    res.addAll(securitySchemes(action.getSecuredBy(), new Message("securityScheme.undefined", new Locator(action))));
  } else if (!action.getResource().getSecuredBy().isEmpty()) {
    res.addAll(securitySchemes(action.getResource().getSecuredBy(), new Message("securityScheme.undefined", new Locator(action.getResource()))));
  } else if (!raml.getSecuredBy().isEmpty()) {
    res.addAll(securitySchemes(raml.getSecuredBy(), new Message("securityScheme.undefined", new Locator())));
  }
  if (res.isEmpty()) {
    res.add(NULL_SCHEMA);
  }
  return res;
}

代码示例来源:origin: guru.nidi.raml/raml-doc-client

@Override
  public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException {
    final Action a = (Action) o;
    switch (propertyName) {
      case "securitySchemes":
        if (a.getSecuredBy() != null && !a.getSecuredBy().isEmpty()) {
          return a.getSecuredBy();
        }
        if (a.getResource().getSecuredBy() != null && !a.getResource().getSecuredBy().isEmpty()) {
          return a.getResource().getSecuredBy();
        }
        if (raml.getSecuredBy() != null && !raml.getSecuredBy().isEmpty()) {
          return raml.getSecuredBy();
        }
        return Collections.emptyList();
      case "type":
        return a.getType().toString();
      case "responses":
        return new TreeMap<>(a.getResponses());
      case "queryParameters":
        return new TreeMap<>(a.getQueryParameters());
      case "headers":
        return new TreeMap<>(a.getHeaders());
      case "body":
        return a.getBody() == null ? null : new TreeMap<>(a.getBody());
      default:
        return super.getProperty(interp, self, o, property, propertyName);
    }
  }
}

代码示例来源:origin: versly/wsdoc

Action action = resource.getAction(ActionType.GET);
AssertJUnit.assertNotNull("RAML default controller has no get action", action);
List<SecurityReference> secRef = action.getSecuredBy();
AssertJUnit.assertNotNull("RAML has no default security reference list", secRef);
AssertJUnit.assertTrue("RAML default controller has a security reference", secRef.size() == 0);
action = resource.getAction(ActionType.POST);
AssertJUnit.assertNotNull("RAML twoscope controller has no get action", action);
secRef = action.getSecuredBy();
AssertJUnit.assertNotNull("RAML has no twoscope security reference list", secRef);
AssertJUnit.assertTrue("RAML twoscope controller get does not have a security reference", secRef.size() == 1);
secRef = action.getSecuredBy();
AssertJUnit.assertNotNull("RAML has no twoscope security reference list", secRef);
AssertJUnit.assertTrue("RAML twoscope controller get does not have a security reference", secRef.size() == 1);

代码示例来源:origin: com.sap.cloud.yaas.service-generator/service-generator-model-raml

final List<SecurityReference> directSecuredBy = source.getSecuredBy();

相关文章