org.springframework.security.oauth2.provider.filter中的OAuth2ProtectedResourceFilter:
Collection<String> resourceIds = auth.getClientAuthentication().getResourceIds();
if (resourceIds!=null && !resourceIds.isEmpty() && !resourceIds.contains(resourceId)) {
throw new InvalidTokenException("Invalid token does not contain resource id ("+resourceId+"): " + token);
}
Run Code Online (Sandbox Code Playgroud)
我觉得它没用.这段代码检查的内容是什么?
我希望我的 Gitlab CI 作业在提交消息以特定字符串开头时不运行:[maven-scm]
因此,我的.gitlab-ci.yaml文件中有以下配置:
image: maven:3.6.3-jdk-11-slim
stages:
- test
test:
stage: test
cache:
key: all
paths:
- ./.m2/repository
script:
- mvn clean checkstyle:check test spotbugs:check
rules:
- if: '$CI_COMMIT_MESSAGE !~ /^\[maven-scm\] .*$/'
Run Code Online (Sandbox Code Playgroud)
我的提交消息是:[maven-scm] I hope the test job does not run
但测试工作仍然让我感到沮丧。我查看了 GitLab 文档中的规则,但找不到该作业仍然运行的原因。我不确定我是否遗漏了一些东西。
如果有人能指出我正确的方向,那就太好了。
更新:
我尝试了 only/ except 子句而不是规则。我将 yaml 文件修改为以下内容:
image: maven:3.6.3-jdk-11-slim
stages:
- test
test:
stage: test
cache:
key: all
paths:
- ./.m2/repository
script:
- mvn clean checkstyle:check test spotbugs:check …Run Code Online (Sandbox Code Playgroud)