【问题标题】:Wiremock docker add OAUTH2Wiremock docker 添加 OAUTH2
【发布时间】:2021-09-17 07:37:46
【问题描述】:

我正在使用 WireMock docker 映像来模拟端点。我正在使用下面的 yaml 在 kubernetes 上创建部署,它工作正常,我添加了 __files 和映射来添加端点和响应。现在我需要添加 OAUTH2 来测试我的应用程序中的身份验证。可以这样做吗?以及我应该添加哪些属性:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: wiremock-helper
  labels:
    app: wiremock-helper
spec:
  replicas: 1
  selector:
    matchLabels:
      app: wiremock-helper
  template:
    metadata:
      labels:
        app: wiremock-helper
    spec:
      containers:
      - name: wiremock-helper
        image: rodolpheche/wiremock:latest
        ports:
          - containerPort: 8080
        volumeMounts:
          - name: wiremock-volume
            mountPath: /home/wiremock
      volumes:
        - name: wiremock-volume
          nfs:
            server: 10.0.0.0
            path: /home/wiremock

【问题讨论】:

    标签: kubernetes oauth-2.0 wiremock


    【解决方案1】:

    我不确定我是否理解您的问题,但如果我理解了,部署将不会处理身份验证或授权。您可以让您的应用程序直接处理这些,使用 API 网关/代理解决方案(envoy、emissary-ingress、traefik、ory oathkeeper 等),或使用服务网格解决方案(Istio with Auth Policy)。

    【讨论】: