Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add applicationPassword & some rest-api compatiable with wordpress rest-api #351

Closed
wants to merge 14 commits into from

Conversation

textworld
Copy link
Contributor

  1. 增加了可供api调用的ApplicationPassword功能
  2. 适配了wordpress的相关rest api接口,适配接口如下

Post

  • List
  • Create
  • Update
  • Delete

Tag

  • List
  • Create
  • Update
  • Delete

Category

  • List
  • Create
  • Update
  • Delete

User

  • List
  • Create
  • Update
  • Delete

@1379
Copy link
Contributor

1379 commented Nov 25, 2023

有几处Linter 错误 :)

}

func verifyHeader(header string) bool {
compile, err := regexp.Compile("^Basic [a-z\\d/+]*={0,2}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以把regexp对象定义成一个全局变量,不需要每次Compile,性能更好

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@1379
Copy link
Contributor

1379 commented Nov 25, 2023

其实我觉得这个功能更适合用插件去实现,不过目前确实还不支持插件:(

@textworld
Copy link
Contributor Author

其实我觉得这个功能更适合用插件去实现,不过目前确实还不支持插件:(

也没必要一定要用插件实现,wordpress已经将类似功能从插件移植到自身了

@1379
Copy link
Contributor

1379 commented Dec 5, 2023

本质上这个接口是对wp的适配,所以我认为不应该放到sonic中。
go最近正在对WASI进行适配,等到可用的时候,会用插件实现这个功能

@textworld
Copy link
Contributor Author

本质上这个接口是对wp的适配,所以我认为不应该放到sonic中。 go最近正在对WASI进行适配,等到可用的时候,会用插件实现这个功能

其实这个应该拆成两部分,一部分是sonic自身的rest-api,这部分可以放到sonic自身,提高整体的可玩性。第二部分是针对wp接口的兼容,这个放插件更合适一点,我还是保留我的意见。

@textworld textworld closed this Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants