go-oauth2 / redis Goto Github PK
View Code? Open in Web Editor NEWRedis storage for OAuth 2.0
Home Page: https://godoc.org/gopkg.in/go-oauth2/redis.v3
License: MIT License
Redis storage for OAuth 2.0
Home Page: https://godoc.org/gopkg.in/go-oauth2/redis.v3
License: MIT License
Since today I get the following error when building the library in docker on top of
golang:1.12.5-alpine
image.
/go/src/gopkg.in/go-oauth2/redis.v3/options.go:78:3: cannot use o.Dialer (type func() (net.Conn, error)) as type func(string, string) (net.Conn, error) in field value
I tried to debug it but i didn't figure it out yet what is causing the error.
Strange is that previous days it was working to build the library
Do you have any idea why?
Quick help will be much appreciated.
Thank you and have a good day!
UPDATE: actually looks like is caused because of this redis/go-redis@3da4357
When I use first step of the "Usage", the 'MapTokenStorage' in IntelliJ IDEA show me an error:
// use redis token store manager.MapTokenStorage(oredis.NewRedisStore(&redis.Options{ Addr: "127.0.0.1:6379", DB: 15, }))
Cannot use 'redisStore' (type *TokenStore) as the type oauth2.TokenStore
Type does not implement 'oauth2.TokenStore'
need the method: Create(info TokenInfo) error
have the method: Create(ctx context.Context, info oauth2.TokenInfo) error
How can I fix it, thank yours very much!
I've discovered it using RedisInsight.
I think you should add a config such as "cluster => true or false"
Nice @LyricTian!
Your library will be shared in our next RedisWeekly :)!
This issue has been opened automaticaly because we think you are using satori/uuid in your code. Unfortunately, satori/uuid has a critical defect where it doesn't generate random UUIDV4s satori/go.uuid#73 and should be replaced as the maintainer has been unresponsive for 5 months with the bug still open. Alternative packages you should consider: https://github.com/google/uuid https://github.com/pborman/uuid
error in go get or go build
go get -u -v gopkg.in/go-oauth2/redis.v3
# gopkg.in/go-oauth2/redis.v3 ..\..\gopath\pkg\mod\gopkg.in\go-oauth2\[email protected]\options.go:79:3: cannot use o.Dialer (type func(context.Context, string, string) (net.Conn, error)) as type func() (net.Conn, error) in field value
Related to this issue #7 error building go-oauth2 redis
Could anyone help fix this?
Thank you very much and have a good day!
When Oauth2 does not modify the refresh_token, it will continue to refresh the access_token, and the data in redis will continue to increase. Although these data have TTL, if the amount of data is large, there will be certain problems.
The problem can be solved by the following code.
iresult := s.cli.Get(s.wrapperKey(checkToken))
if err := iresult.Err(); err != nil && err != redis.Nil {
return err
} else if iresult.Val() == "" || iresult.Val() != basicID {
return s.remove(basicID)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.