我有一個 nexus OSS 服務器,我們用它來為我們的 java jar 提供服務。
我們為我們的專案創建了一個 repo,它要求客戶端傳遞用戶名和密碼來下載 maven 依賴項。
現在,我們還需要一個 repo,用戶應該能夠從中下載人工制品而無需傳遞任何憑據。
是否可以在單個 Nexus OSS 服務器上托管兩個存盤庫,一個由基本身份驗證支持,另一個允許匿名訪問?
uj5u.com熱心網友回復:
我報告的解決方案在https://support.sonatype.com/hc/en-us/articles/360050779593-How-to-grant-anonymous-access-to-a-specific-repository- 中有解釋:
To restrict anonymous access to a single repository you can create your own anonymous role with targeted permissions and assign it to the anonymous user.
1. Create a new role with the permissions you would like to grant to the anonymous user.
For example, the following allows read and browse privileges to a maven2 repository:
nx-repository-view-maven2-<repo-id>-read
nx-repository-view-maven2-<repo-id>-browse
The read privilege allows downloads, and the browse privilege allows a user to see the repository's contents in the UI.
You may also want to add the "nx-search-read" privilege to allow searching.
2. Then in Security > Users remove the default nx-anonymous role from the anonymous user, and replace it with the new role.
3. Make sure anonymous access is enabled in Security > Realms. Verify that the "local authenticating realm" and "local authorizing realm" are in the active realm list.
4. Make sure anonymous access is enabled. In Security > Anonymous make sure the check box to Allow anonymous access to the server is checked. Also make sure the realm of the anonymous user is "local authorizing realm".
Additional documentation regarding anonymous access is provided here:
https://help.sonatype.com/repomanager3/system-configuration/user-authentication/anonymous-access
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/357507.html
上一篇:重新加載頁面并停留在當前頁面
