Currently, ohpm-repo supports certificate authentication and AccessToken authentication.
Certificate authentication: When the publish, unpublish, or dist-tags command is executed on the ohpm client, the encrypted SSH certificate is embedded for identity authentication.
AccessToken authentication: Add the access token generated by ohpm-repo to the ohpm client configuration file to implement password-free authentication for operations including publish, unpublish, dist-tags, info, and install.
Before using ohpm to publish packages, you need to set publish_id and key_path in the .ohpmrc configuration file. publish_id indicates the publishing ID, and key_path corresponds to the address of the private key. For details about the publishing process, see Publishing with the CLI Tool. Authentication management is used to manage the public key information corresponding to the private key and verify the information when users use ohpm to publish packages. The following figure shows the Security manage page.




Access token is a new authentication mechanism introduced in ohpm-repo 2.1.0 (the ohpm CLI tool of 1.6.0 or later is required). You can generate a token on the ohpm-repo page and add it to the configuration file of the ohpm client. When interacting with ohpm-repo, the client automatically attaches a token for identity authentication.
The token has two permission levels: read-only token that allows info and install operations; read-write token that supports publish, unpublish, and dist-tags operations in addition to operations of the read-only permission. A maximum of 10 tokens can be generated for each permission type. When a token is generated for the first time, the system automatically copies it to the clipboard and does not display the complete token content later. The following figure shows the AccessToken page.





//127.0.0.1:8088/repos/ohpm/:_auth=readWriteToken //127.0.0.1:8088/repos/ohpm/:_read_auth=readOnlyToken
//127.0.0.1:8088/repos/ohpm/ is the registry value without the protocol name. :_auth and :_read_auth indicate the read-write token and read-only token, respectively. readWriteToken and readOnlyToken indicate the token values. If the ohpm client executes the info and install commands, it preferentially uses read-only tokens over read-write tokens. If the ohpm client executes the publish, unpublish, and dist-tags commands, it uses only read-write tokens. For each type of token, a maximum of three tokens can be configured.