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

[ApiGateway] Make authenticators serializable with to_dict() #5638

Merged
merged 5 commits into from
May 30, 2024

Conversation

alonmr
Copy link
Member

@alonmr alonmr commented May 27, 2024

Since the authenticators are not serializable, it was not possible to send the application object over http when enriched the api gateway authenticator objects. This makes them serializable with only minimal information as it is not relevant to deploying or saving the function, only for metadata. When we actually create the API gateway we enrich with authentication information.

Copy link
Member

Choose a reason for hiding this comment

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

Just to simplify the inheritance a bit, I would suggest something of this sort:

class Authenticator(typing.Protocol):
    # same implementation as the current APIGatewayAuthenticator...

class APIGatewayAuthenticator(Authenticator, ModelObj):
    _dict_fields = ["authentication_mode"]

class class NoneAuth(APIGatewayAuthenticator):
    # same thing...

@alonmr alonmr merged commit 5d8c6d7 into mlrun:development May 30, 2024
11 checks passed
@alonmr alonmr deleted the application-stuff branch May 30, 2024 11:10
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.

None yet

3 participants