Skip to content

AIP-81 Handle Empty Credentials #49139

Closed

Description

@bugraoz93

Body

Check if credentials are loaded in each command (airflowctl) and ask user to login otherwise.

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Activity

  1. added
    kind:meta
    on Apr 11, 2025
  2. added theissue type on Apr 11, 2025
  3. bugraoz93 commented on Apr 12, 2025

    @bugraoz93
    ContributorAuthor

    @aritra24 On a second thought, to keep the logs for users on the ctl side, not on the api side, we can create a base method for ActionCommand and check if credential exists. We can call the Credentials method to check_if_exist new one to check without loading the credentials. We should also check if it expires to warn, but that can be another issue. What do you think?

  4. aritra24 commented on Apr 12, 2025

    @aritra24
    Collaborator

    Yeah, that makes sense. So to confirm we add a base method in actioncommand that calls credentials.check_if_exists before each command? Also I don't fully understand the without loading the credentials. Is there a specific reason to not load it except it'd ask for the password?

  5. Prab-27 commented on Apr 13, 2025

    @Prab-27
    Contributor

    @bugrao, are you referring to providing a warning about token expiration? If so, I'd like to work on that issue. Could you please assign it to me?

    cc: @aritra24

  6. aritra24 commented on Apr 13, 2025

    @aritra24
    Collaborator

    Hi @Prab-27, I'm already looking into this one so you can try picking up some other tasks...

  7. Prab-27 commented on Apr 13, 2025

    @Prab-27
    Contributor

    I understand the different issues related to this matter, and that’s why I asked for clarification.
    Apologies for any confusion caused

  8. bugraoz93 commented on Apr 13, 2025

    @bugraoz93
    ContributorAuthor

    Yeah, that makes sense. So to confirm we add a base method in actioncommand that calls credentials.check_if_exists before each command? Also I don't fully understand the without loading the credentials. Is there a specific reason to not load it except it'd ask for the password?

    @aritra24 As a concept, we are encapsulating the Client with embedded loaded credentials to each ActionCommand itself. This makes a functional Client in the methods. What we shouldn't do is load credentials on the CTL level (ctl package level https://github.com/apache/airflow/tree/main/airflow-ctl/src/airflowctl/ctl) without encapsulating them into the Client. That's why I offered the check_if_exists without actually loading the key but checking if the environment exists, which means airflowctl auth login never ran. If it exists but still getting an error for the expired token, that falls into the case of the token being expired. For that, we should do an additional check on the Client side while initialising so that somehow we can prevent being called by the command itself.

  9. bugraoz93 commented on Apr 13, 2025

    @bugraoz93
    ContributorAuthor

    I understand the different issues related to this matter, and that’s why I asked for clarification. Apologies for any confusion caused

    Thanks a lot @Prab-27 for your interest! I will ping you in case there will be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:meta

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions