<#601 Introduce pre redirect hook plugin during au...
# flyte-github
c
#601 Introduce pre redirect hook plugin during auth callback Pull request opened by pmahindrakar-oss TL;DR Introduces a preRedirectHook plugin handler to allow custom code to be able to be plugged in before the successful auth call back redirect happens Type ☐ Bug Fix ☑︎ Feature ☐ Plugin Are all requirements met? ☑︎ Code completed ☑︎ Smoke tested ☑︎ Unit tests added ☐ Code documentation added ☐ Any pending items have an associated Issue Complete description
Copy code
type PreRedirectHookFunc func(ctx context.Context, authCtx interfaces.AuthenticationContext, request *http.Request, w http.ResponseWriter) *PreRedirectHookError
PreRedirectHookFunc Interface is used for running custom code before the redirect happens during a successful auth flow. The API allows you to access the authenticationContext, request and response This might be useful in cases where the auth flow allows the user to login since the IDP has been configured for eg: to allow all users from a particular domain to login but you want to restrict access to only a particular set of user ids. eg : users@domain.com are allowed to login but user user1@domain.com, user2@domain.com should only be allowed The current Plugin hook will allow you to add such a custom code. PreRedirectHookError is the error interface which allows the user to set correct http status code and Message to be set in case the function returns an error without which the current usage in GetCallbackHandler will set this to InternalServerError Tracking Issue fixes flyteorg/flyte#3940 Follow-up issue NA flyteorg/flyteadmin GitHub Actions: End2End Test / End to End tests GitHub Actions: Integration Test / Integration tests GitHub Actions: Lint / Run Lint 7 other checks have passed 7/10 successful checks
a