def get_credentials()

in src/artifacts-credprovider-conda/src/activate/artifacts-cred.py [0:0]


    def get_credentials(self, url):
        # Public feed short circuit: return nothing if the endpoint is public (can authenticate without credentials).
        if self._can_authenticate(url, None):
            return None, None

        # Getting credentials with IsRetry=false; the credentials may come from the cache
        username, password = self._get_credentials_from_credential_provider(url, is_retry=False)
        
        # Do not attempt to validate if the credentials could not be obtained
        if username is None or password is None:
            return username, password

        # Make sure the credentials are still valid (i.e. not expired)
        if self._can_authenticate(url, (username, password)):
            return username, password

        # The cached credentials are expired; get fresh ones with IsRetry=true
        return self._get_credentials_from_credential_provider(url, is_retry=True)