servicecomb-service-center icon indicating copy to clipboard operation
servicecomb-service-center copied to clipboard

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

Open zhaoqi211 opened this issue 1 year ago • 2 comments

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):

zhaoqi211 avatar Sep 03 '22 08:09 zhaoqi211

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

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

tianxiaoliang avatar Sep 05 '22 02:09 tianxiaoliang

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

dongnandeday avatar Nov 03 '22 11:11 dongnandeday