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

837 new policies #868

Merged
merged 31 commits into from
Oct 19, 2022
Merged

837 new policies #868

merged 31 commits into from
Oct 19, 2022

Conversation

jasmingacic
Copy link
Contributor

@jasmingacic jasmingacic commented Oct 13, 2022

fixes #837

This PR has breaking changes to the policies (formerly known as extensions) schema.

I decided to go with host instead of authorizer-hostname and authorizer-port. It makes it easier to copy past shorter property names

x-kusk:
  auth:
    cloudentity:
      host:
         hostname: cloudentity-authorizer-standalone-authorizer.kusk-system
         port: 9004

scheme: Basic is now custom

x-kusk:
  auth:
    custom:
       host:
         hostname: example.com
         port: 80
x-kusk:
  auth:
    oauth2:
      token_endpoint: *TOKEN_ENDPOINT* # <- for example https://yourdomain.eu.auth0.com/oauth/token
      authorization_endpoint: *AUTHORIZATION_ENDPOINT* # <- for example https://yourdomain.eu.auth0.com/authorize
      credentials:
        client_id: *CLIENT_ID*
        client_secret: *CLIENT_SECRET*
      redirect_uri: /oauth2/callback
      redirect_path_matcher: /oauth2/callback
      signout_path: /oauth2/signout
      forward_bearer_token: true
      auth_scopes:
        - opened

This one is ugly but I opted for underscores instead of hyphen because it is easier to select words with underscore in it. I think we should take this property to the "drawing board"

x-kusk: 
  public_api_path: /openapi

disabled is now hidden. Hidden is more descriptive than disabled as the endpoint isn't really disabled but just hidden from the users.

/path:
  x-kusk:
    hidden: true

All tests have passed locally and on are remote cluster. We only need to wait on the CI to agree with that.

jasmingacic and others added 3 commits October 11, 2022 13:25
Signed-off-by: Mohamed Bana <mohamed@bana.io>
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
@netlify
Copy link

netlify bot commented Oct 13, 2022

Deploy Preview for kusk-docs-preview ready!

Name Link
🔨 Latest commit 1f583e6
🔍 Latest deploy log https://app.netlify.com/sites/kusk-docs-preview/deploys/634e6a9927d9cd000ca35211
😎 Deploy Preview https://deploy-preview-868--kusk-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
.
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
.
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
@jasmingacic
Copy link
Contributor Author

While at this change we should start designing how JWT should fit into policies. I already have a proposal in this issue -> #402

@jasmingacic jasmingacic marked this pull request as ready for review October 14, 2022 10:12
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
@jasmingacic
Copy link
Contributor Author

Note: In this PR i have disabled check-cache as it was failing too often for integration tests to be practical

@mbana
Copy link
Contributor

mbana commented Oct 14, 2022

Note: In this PR i have disabled check-cache as it was failing too often for integration tests to be practical

Good choice.

Copy link
Contributor

@mbana mbana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Needs a few changes though.

config/manager/manager.yaml Outdated Show resolved Hide resolved
pkg/options/options.go Show resolved Hide resolved
pkg/options/auth_test.go Outdated Show resolved Hide resolved
internal/controllers/parser.go Show resolved Hide resolved
internal/controllers/parser.go Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
@jasmingacic jasmingacic requested a review from mbana October 17, 2022 11:17
docs/docs/extension.md Outdated Show resolved Hide resolved
pkg/options/auth_test.go Outdated Show resolved Hide resolved
pkg/options/cache.go Outdated Show resolved Hide resolved
pkg/options/cors.go Outdated Show resolved Hide resolved
pkg/options/host.go Outdated Show resolved Hide resolved
pkg/options/redirect.go Outdated Show resolved Hide resolved
pkg/options/rewrite.go Outdated Show resolved Hide resolved
pkg/options/static_options.go Outdated Show resolved Hide resolved
pkg/options/upstream.go Outdated Show resolved Hide resolved
pkg/options/validation.go Outdated Show resolved Hide resolved
jasmingacic and others added 5 commits October 17, 2022 13:52
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
jasmingacic and others added 11 commits October 17, 2022 13:53
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Co-authored-by: Kyle Hodgetts <kyle@kubeshop.io>
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
Copy link
Contributor

@kylehodgetts kylehodgetts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Feel free to merge once the E2E tests have passed

@jasmingacic
Copy link
Contributor Author

@aabedraba do you need more input for the docs update? I tried to fix where I could

docs/docs/extension.md Outdated Show resolved Hide resolved
Comment on lines +68 to +69
if o.OAuth2 != nil && o.Custom != nil {
return fmt.Errorf("custom auth and OAuth2 cannot be enabled at the same time")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a generic check:
if: more than 1 auth mechanism is defined
return: Only 1 authentication mechanism allowed

or something like that? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's already in place

Co-authored-by: Abdallah Abedraba <aabedraba@gmail.com>
@jasmingacic jasmingacic merged commit 5b407b3 into main Oct 19, 2022
@jasmingacic jasmingacic deleted the 837_new_policies branch October 19, 2022 00:26
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

Successfully merging this pull request may close these issues.

Changes to Kusk Policy
4 participants