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

how to implement the feature of cipher plugin in service-center? #1338

Open
zhaoqi211 opened this issue Sep 3, 2022 · 2 comments
Open

how to implement the feature of cipher plugin in service-center? #1338

zhaoqi211 opened this issue Sep 3, 2022 · 2 comments

Comments

@zhaoqi211
Copy link

Describe the bug
When I use tls feature in service-center(Reference Example of plugin.md -> # Plug-in mechanism), I got an error of,
ERROR plugin/loader.go:53 no any plugin has been loaded {"error": "load plugin 'cipher' error for plugin: not implemented"}
image

To Reproduce
Steps to reproduce the behavior:

  1. create a go file to implement the Cipher interface
package main

func Encrypt(src string) (string, error) {
        return src,nil
}
func Decrypt(src string) (string, error) {
        return src,nil
}
  1. compile go file to generate so
GOPATH=go build -o cipher_plugin.so -buildmode=plugin cipher_plugin.go
  1. move the cipher_plugin.so to plugins directory
  2. restart service-center and then I see error

If I remove the cipher_plugin.go from plugins dir, and with plaintext password in cert_pwd file , The tls feature is normal

Expected behavior
A clear and concise description of what you expected to happen.

Platform And Runtime (please complete the following information):

@tianxiaoliang
Copy link
Contributor

tianxiaoliang commented Sep 5, 2022

https://go-chassis.readthedocs.io/en/latest/dev-guides/codec.html

cipher plugin is using go chassis plugin now. do not use go plugin

@dongnandeday
Copy link

我用的是1.3.0 版本的 通过上述步骤 也是同样的报错?是不是版本有问题不支持吗?
ERROR plugin/loader.go:53 no any plugin has been loaded {"error": "load plugin 'cipher' error for plugin: not implemented"}

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

No branches or pull requests

3 participants