Skip to content

Conversation

@isomacM
Copy link
Contributor

@isomacM isomacM commented Apr 23, 2025

Wieder mal eine Änderung der Authentifizierung: der resume_path muss anders geholt werden


# auth step 3: get token
def get_auth_token(self) -> Optional[str]:
def get_auth_token(self) -> str or None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def get_auth_token(self) -> str or None:
def get_auth_token(self) -> Optional[str]:

Die Schreibweise folgt dem Python Style Guide.


# auth step 2: get code
def _get_auth_code(self) -> Optional[str]:
def _get_auth_code(self) -> str or None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def _get_auth_code(self) -> str or None:
def _get_auth_code(self) -> Optional[str]:


# auth step 1: get resumePath
def _get_auth_resumePath(self) -> Optional[str]:
def _get_auth_resumePath(self) -> str or None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def _get_auth_resumePath(self) -> str or None:
def _get_auth_resumePath(self) -> Optional[str]:

try:
result = self.client_session.post(
BASE_URL+f"/as/{self.resume_path}/resume/as/authorization.ping",
BASE_URL + f"{self.resume_path}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
BASE_URL + f"{self.resume_path}",
f"{BASE_URL}{self.resume_path}",

Hier vermischt Du zwei Darstellungsweisen eines Strings.
Oder die ältere Variante:

Suggested change
BASE_URL + f"{self.resume_path}",
BASE_URL + self.resume_path,

data = {"pf.submit": True, "subject": uid}
result = self.client_session.post(
BASE_URL+f"/as/{self.resume_path}/resume/as/authorization.ping",
BASE_URL + f"{self.resume_path}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
BASE_URL + f"{self.resume_path}",
f"{BASE_URL}{self.resume_path}",

@isomacM
Copy link
Contributor Author

isomacM commented May 7, 2025

Das war wohl ein Schnellschuss...
Flake fällt aus, kennt 'Optional' nicht, ich auch nicht...
Wie ist die korrekte Syntax?

@LKuemmel LKuemmel merged commit 9b966a7 into openWB:master May 8, 2025
1 check passed
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.

2 participants