Skip to content

Instantly share code, notes, and snippets.

@leandromoreira
Created April 12, 2020 21:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save leandromoreira/407e59ef2cfd6a858326101a45c56896 to your computer and use it in GitHub Desktop.
# run this in one tab
docker run --rm -it --name some-redis redis
# run this in another tab
docker exec -it some-redis redis-cli
127.0.0.1:6379> set authentication "access_by_lua_block||if token ~= 'token' then \n return ngx.exit(ngx.HTTP_FORBIDDEN) \n else \n ngx.header['Set-Cookie'] = {'superstition=token'} \n end"
OK
127.0.0.1:6379> get authentication
"access_by_lua_block||if token ~= 'token' then \n return ngx.exit(ngx.HTTP_FORBIDDEN) \n else \n ngx.header['Set-Cookie'] = {'superstition=token'} \n end"
127.0.0.1:6379> sadd coding_units authentication
(integer) 1
127.0.0.1:6379> smembers coding_units
1) "authentication"
127.0.0.1:6379> sadd coding_units anewcomputingunit
(integer) 1
127.0.0.1:6379> smembers coding_units
1) "authentication"
2) "anewcomputingunit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment