小编sap*_*n99的帖子

couchdb自定义身份验证处理程

我不得不承认我对这个话题还不熟悉,特别是对erlang的新手.目前,我正在尝试使用各种身份验证处理程序 - 目标是在facebook,twitter等上进行"委托身份验证".

  1. 据我所知,couchdb的oAuth实现与我需要的完全相反.您可以使用它为沙发用户创建令牌,但不能接受Twitter accessTokens/secrets并将其映射到沙发用户.
  2. 我在datacouch中找到了我需要的东西 - 使用nodejs对twitter进行身份验证,然后从私人沙发中获取明文密码并使用_session-API创建沙发cookie.

现在我试图避免存储明文密码.我听说过使用proxy_authentification_handler,但看起来我要么太缺乏经验,要么使用它太愚蠢.我在couch_httpd_auth中做了(据我所知)正确的条目

couch_httpd_auth    auth_cache_size         50
                    authentication_db       _users
                    authentication_redirect /_utils/session.html
                    require_valid_user      false
                    proxy_use_secret        false
                    secret                  xxxxxxxxxxxx
                    timeout                 43200 
                    x_auth_roles            roles
                    x_auth_token            token
                    x_auth_username         uname
Run Code Online (Sandbox Code Playgroud)

以及httpd中的部分

httpd               allow_jsonp             true
                    authentication_handlers {couch_httpd_auth, proxy_authentification_handler},{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}
                    bind_address            127.0.0.1
                    default_handler         {couch_httpd_db, handle_request} 
                    port                    5984
                    secure_rewrites         false
                    vhost_global_handlers   _utils, _uuids, _session, _oauth, _users
Run Code Online (Sandbox Code Playgroud)

正如文档中的注释中所提到的,我将proxy_use_secret设置为false(对于第一步)以允许在没有访问令牌的情况下进行身份验证.

当我现在在http:// localhost:5984/_utils/config.html?uname = user1&roles = user上进行GET时似乎不会影响任何事情......

谁有人跑过这个东西?我错过了什么吗?或者是否有机会在不编码erlang的情况下实现自定义身份验证处理程序?

非常感谢你的帮助

couchdb node.js

6
推荐指数
1
解决办法
1460
查看次数

两个 Pod 之间的 istio 路由

试图在 kubernetes 上进入 istio,但似乎我缺少一些基础知识,或者我正在做一些事情。我在 kubernetes 方面很有经验,但是 istio 及其虚拟服务让我有点困惑。

我创建了 2 个部署 (helloworld-v1/helloworld-v2)。两者都有相同的图像,唯一不同的是环境变量 - 输出版本:“v1”或版本:“v2”。我正在使用我编写的一个小测试容器,它基本上返回了我进入应用程序的标题。一个名为“helloworld”的 kubernetes 服务可以同时访问这两者。

我创建了一个 Virtualservice 和一个 Destinationrule

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: helloworld
spec:
  hosts:
  - helloworld
http:
  - route:
     - destination:
       host: helloworld
       subset: v1
     weight: 90
     - destination:
       host: helloworld
       subset: v2
     weight: 10
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: helloworld
spec:
  host: helloworld
  subsets:
  - name: v1
    labels:
      version: v1
  - name: v2
    labels:
      version: v2
Run Code Online (Sandbox Code Playgroud)

根据文档,没有提到任何网关都应该使用内部“网状”网关。Sidecar 容器已成功附加:

kubectl -n demo get …
Run Code Online (Sandbox Code Playgroud)

kubernetes istio

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

标签 统计

couchdb ×1

istio ×1

kubernetes ×1

node.js ×1