Code Monkey home page Code Monkey logo

Comments (14)

ariwori avatar ariwori commented on July 21, 2024

插件开发获取用户信息文档不全

from plugin-starter.

guqing avatar guqing commented on July 21, 2024

文档问题建议到 halo-dev/docs 提交 issue,至于你说的引入第三方依赖报错,建议提供日志,以及引入的是什么依赖,目前无法复现

from plugin-starter.

guqing avatar guqing commented on July 21, 2024

/kind needs-information

from plugin-starter.

f2c-ci-robot avatar f2c-ci-robot commented on July 21, 2024

@guqing: The label(s) kind/needs-information cannot be applied, because the repository doesn't have them.

In response to this:

/kind needs-information

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from plugin-starter.

ariwori avatar ariwori commented on July 21, 2024

https://github.com/Wechat-Group/WxJava
引入这个的企业微信开发,一写相关逻辑就会报错

from plugin-starter.

guqing avatar guqing commented on July 21, 2024

Wechat-Group/WxJava 引入这个的企业微信开发,一写相关逻辑就会报错

建议提供复现步骤以及详细的日志,而不是这样笼统的描述,我怎么复现呢

from plugin-starter.

ariwori avatar ariwori commented on July 21, 2024

暂时放弃这个依赖了,自己实现功能了,不理它先
想问一下怎么样在插件理做免登录验证的接口

from plugin-starter.

guqing avatar guqing commented on July 21, 2024

暂时放弃这个依赖了,自己实现功能了,不理它先 想问一下怎么样在插件理做免登录验证的接口

参考文档 聚合角色
通过定义角色模板并聚合到 anonymous 角色上实现免登陆

from plugin-starter.

ariwori avatar ariwori commented on July 21, 2024

好的,谢谢

from plugin-starter.

ariwori avatar ariwori commented on July 21, 2024

image
image
请问我这样写有什么问题吗,接口还是401

from plugin-starter.

guqing avatar guqing commented on July 21, 2024

角色模板的 rules 配置错了,参考文档:API 权限控制
角色模板的 rules 中的 apiGroups,resources 根据路由规则来套 /apis/<apiGroup>/<version>/<resource>[/<resourceName>/<subresource>]
因此按照你定义的路由,app 是 resource,reveiveMsg 是 resourceName

from plugin-starter.

ariwori avatar ariwori commented on July 21, 2024

image
image
POST请求成功了,GET请求还是401
image
image

from plugin-starter.

guqing avatar guqing commented on July 21, 2024

试试

apiVersion: v1alpha1
kind: Role
metadata:
  name: qywx-role
  labels:
    halo.run/role-template: "true"
    rbac.authorization.halo.run/aggregate-to-anonymous: "true"
rules:
  # 以 apis 开头的 API 是资源型 URL,需要指定 apiGroups 和 resources
  - apiGroups: [ "wqlin.halo.run" ]
    resources: [ "app" ]
    resourceNames: [ "receiveMsg" ]
    verbs: [ "get" ]
  # 这个 URL 虽然以 /apis 开头,但是路径中有 resourceName 段,创建时通过不可能在路径中包含 resourceName,所以是非资源型 URL
  - nonResourceURLs: [ "/apis/wqlin.halo.run/v1alpha1/app/receiveMsg" ]
    verbs: [ "create" ]

需要注意的是,开发插件时建议使用自己的域名作为 group,不要使用 halo.run,为了根据规则定义合适的 API,你可以选择这样定义
/apis/api.your-domain.com/v1alpha1/apps/-/receiveMsg即通过-来代替名称,将 action 放到后面一段

from plugin-starter.

ariwori avatar ariwori commented on July 21, 2024

好的,谢谢

from plugin-starter.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.