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

Update examples for latest version of tyk #10

Open
armujahid opened this issue Aug 22, 2022 · 2 comments
Open

Update examples for latest version of tyk #10

armujahid opened this issue Aug 22, 2022 · 2 comments

Comments

@armujahid
Copy link

armujahid commented Aug 22, 2022

Current examples are using older versions of tyk. I think we should update examples to support latest version
I was able to compile few basic examples for 4.0.4 version using these steps:

rm -rf go.mod go.sum vendor/
go mod init tyk-plugin
go mod edit -replace github.com/jensneuse/graphql-go-tools=github.com/TykTechnologies/graphql-go-tools@v1.6.2-0.20220426094453-0cc35471c1ca
go get github.com/TykTechnologies/tyk@af3430ae6e1ca689365bf67416c590d3201b7929
<Write and finalize code>
go mod tidy
go mod vendor
docker container run -v $(pwd):/plugin-source --rm tykio/tyk-plugin-compiler:v4.0.4 plugin.so

Signature of ctx.SetSession is changed in latest version that's why go-auth-multiple_hook_example isn't compiling.

Related: https://community.tyk.io/t/go-auth-plugin-example-with-latest-tyk-version-v4-0-4/5635

@armujahid
Copy link
Author

gRPC golang auth examples like https://github.com/TykTechnologies/custom-plugins/tree/master/plugins/grpc_go-auth-pre_headerinject_authhook is also not compiling. I am getting this error while trying to run this example using

go mod init tyk-plugin
go mod tidy
 github.com/TykTechnologies/tyk-protobuf/bindings/go: module github.com/TykTechnologies/tyk-protobuf@latest found (v0.0.0-20220714214409-d0cb35aefc54), but does not contain package github.com/TykTechnologies/tyk-protobuf/bindings/go

@armujahid
Copy link
Author

I have created this example https://github.com/armujahid/tyk-grpc-go-mongo-accesstoken/ that can be included in this repo. This example is containerized and can be forked to create/deploy grpc plugin on k8s

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

1 participant