19

向 Gollum wiki 添加多角色访问权限的最佳方式是什么?

我了解如何通过 Rack 中间件添加基本 HTTP 身份验证。但是,我想知道拥有完整的多用户/角色身份验证和授权需要什么。

是否可以像使用 Rails 应用程序一样使用 Devise 或 OmniAuth?

需要什么?

4

5 回答 5

17

有了这个提示http://www.sinatrarb.com/faq.html#auth我的配置文件是这样的

# authentication.rb
module Precious
  class App < Sinatra::Base
    use Rack::Auth::Basic, "Restricted Area" do |username, password|
      [username, password] == ['admin', 'admin']
    end
  end
end

并运行为:

$ gollum --config authentication.rb

在运行的 gollum 实例中,它会询问用户名和密码

于 2012-11-13T08:33:11.163 回答
6

还有一个omnigollum 项目(https://github.com/arr2036/omnigollum)来支持omniauth 和gollum。

于 2013-11-11T14:00:34.157 回答
2

我在这里找到了一个基本的 http-auth 扩展:https ://gist.github.com/2224709

于 2012-03-28T08:44:38.983 回答
1

把这个留给有兴趣的人:使用vigntom的方法,我做了一个repo,为Gollum添加了基本的身份验证,准备好了。我将凭据放在 yaml 文件中,以防止它们在 repo 中被硬编码。

https://github.com/mrchameleon/precious

于 2014-03-13T00:47:45.843 回答
0

在这个线程中

https://github.com/gollum/gollum/issues/107

Gollum 开发人员之一给出了一些提示。似乎还没有已知的分叉/项目。

于 2012-03-12T21:04:57.257 回答