小编Dha*_*ran的帖子

在使用Spring Security的OAuth 2.0中,resourceId意味着什么

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)

我觉得它没用.这段代码检查的内容是什么?

spring oauth-2.0 spring-security-oauth2

13
推荐指数
2
解决办法
8065
查看次数

基于正则表达式的规则子句在 GitLab CI 中不起作用

我希望我的 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)

continuous-integration gitlab gitlab-ci gitlab-ci-runner

5
推荐指数
1
解决办法
5305
查看次数