diff --git a/api使用和版本发布.md b/api使用和版本发布.md index 32ef81e..9f46778 100644 --- a/api使用和版本发布.md +++ b/api使用和版本发布.md @@ -1,5 +1,34 @@ 接口:https://git.ewancle.com/api/swagger 和使用教程:https://docs.gitea.com/zh-cn/development/api-usage # 全部作用列表https://docs.gitea.com/zh-cn/development/oauth2-provider +```xml +activitypub activitypub API routes: ActivityPub related operations. + read:activitypub Grants read access for ActivityPub operations. + write:activitypub Grants read/write/delete access for ActivityPub operations. +admin /admin/* API routes: Site-wide administrative operations (hidden for non-admin accounts). + read:admin Grants read access for admin operations, such as getting cron jobs or registered user emails. + write:admin Grants read/write/delete access for admin operations, such as running cron jobs or updating user accounts. +issue issues/*, labels/*, milestones/* API routes: Issue-related operations. + read:issue Grants read access for issues operations, such as getting issue comments, issue attachments, and milestones. + write:issue Grants read/write/delete access for issues operations, such as posting or editing an issue comment or attachment, and updating milestones. +misc Reserved for future usage. + read:misc Reserved for future usage. + write:misc Reserved for future usage. +notification notification/* API routes: user notification operations. + read:notification Grants read access to user notifications, such as which notifications users are subscribed to and read new notifications. + write:notification Grants read/write/delete access to user notifications, such as marking notifications as read. +organization orgs/* and teams/* API routes: Organization and team management operations. + read:organization Grants read access to org and team status, such as listing all orgs a user has visibility to, teams, and team members. + write:organization Grants read/write/delete access to org and team status, such as creating and updating teams and updating org settings. +package /packages/* API routes: Packages operations + read:package Grants read access to package operations, such as reading and downloading available packages. + write:package Grants read/write/delete access to package operations. Currently the same as read:package. +repository /repos/* API routes except /repos/issues/*: Repository file, pull-request, and release operations. + read:repository Grants read access to repository operations, such as getting repository files, releases, collaborators. + write:repository Grants read/write/delete access to repository operations, such as getting updating repository files, creating pull requests, updating collaborators. +user /user/* and /users/* API routes: User-related operations. + read:user Grants read access to user operations, such as getting user repo subscriptions and user settings. + write:user Grants read/write/delete access to user operations, such as updating user repo subscriptions, followed users, and user settings. +``` curl -X POST "https://git.ewancle.com/api/v1/users/xiehaijun/tokens" \ -H "Authorization: token f5856ff0aecd675b72c1910bd4a19679927a6ba0" \ -H "Content-Type: application/json" \ @@ -33,6 +62,39 @@ curl -X 'POST' \ "write:organization" ] }' + +# 全部的权限token :"sha1":"ec5e01f597b42492c1c7a73f9997435fc83c1093" +curl -X 'POST' \ + 'https://git.ewancle.com/api/v1/users/xiehaijun/tokens' \ + -u 'xiehaijun:Xiehaijun945' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "name": "full-super-token", + "scopes": [ + "read:activitypub", + "write:activitypub", + "read:admin", + "write:admin", + "read:issue", + "write:issue", + "read:misc", + "write:misc", + "read:admin", + "write:admin", + "read:notification", + "write:notification", + "read:package", + "write:package", + "write:repository", + "read:repository", + "read:user", + "write:user", + "read:organization", + "write:organization" + ] +}' + # 获取token,需要read:admin,write:admin curl -X 'GET' \ 'https://git.ewancle.com/api/v1/users/xiehaijun/tokens' \