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

kong <> permit.io - OPA - Open Policy Agent #99

Open
manjeshpv opened this issue Oct 27, 2023 · 1 comment
Open

kong <> permit.io - OPA - Open Policy Agent #99

manjeshpv opened this issue Oct 27, 2023 · 1 comment

Comments

@manjeshpv
Copy link

when i hit kong api via postman

i noticed, kong hit permit.io sidecar with below body

{
    "input": {
        "client_ip": "10.0.1.10",
        "request": {
            "http": {
                "tls": {},
                "method": "GET",
                "querystring": {},
                "port": "8000",
                "host": "api.example.com",
                "headers": {
                    "user-agent": "PostmanRuntime/7.33.0",
                    "cache-control": "no-cache",
                    "host": "api.example.com",
                    "x-real-ip": "000.000.000.000", << i made this 000 for security
                    "authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwic2Vzc2lvbl9pZCI6MSwiaWF0IjoxNjg4OTg3Mjk1LCJleHAiOjE2ODg5OTA4OTV9.wm_Y6f83BbceoL81dHjFR3eGa0Nd2UvvdSEMDnq7cKw",
                    "accept": "*/*",
                    "x-forwarded-for": "000.000.000.000",
                    "accept-encoding": "gzip, deflate, br",
                    "postman-token": "85003413-31ce-4196-ac12-40d4eab6318c",
                    "connection": "close",
                    "x-forwarded-proto": "https"
                },
                "scheme": "http",
                "path": "/hello"
            }
        }
    }
}

@manjeshpv
Copy link
Author

got some idea from https://www.permit.io/blog/no-code-permissions-with-kong-and-permitio

For example, using the default translation table, consider the following request:

POST /v2/repository

Authorization: Bearer [bearer token for [email protected]]

This will be translated into:

Can [email protected] do post on repository?


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