Uh oh!
There was an error while loading. Please reload this page.
feat: app registration authentication for equnor pi webapi - #472
Open
asmfstatoil wants to merge 4 commits into
Open
feat: app registration authentication for equnor pi webapi#472asmfstatoil wants to merge 4 commits into
asmfstatoil wants to merge 4 commits into
Conversation
asmfstatoil
commented
Apr 27, 2026
CollaboratorAuthor
Arbeider med PI-teamet for å få autentisering til å virke med app-registrering. Kan hende det vert endring i client app-id |
asmfstatoil
marked this pull request as draft
May 12, 2026 13:56
asmfstatoilforce-pushed
the
radix_preparation
branch
2 times, most recently
from
June 23, 2026 22:32
0d53c2f to
5024deaCompareasmfstatoil
marked this pull request as ready for review
August 18, 2026 13:39
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (6)
tagreader/web_handlers.py:86
http.cookiejar.Cookiecannot be constructed with onlyname/value/domain/...keyword args; the constructor requires many required fields (e.g.,version,port,domain_specified, etc.). This will raiseTypeErrorwhen converting Playwright cookies. Consider building arequests.cookies.RequestsCookieJarand using.set(...)instead.
def browser_context_to_cookiejar(
context: BrowserContext, domain_filter: Optional[str] = None
):
"""Convert Playwright browser context cookies to a Requests cookie jar."""
cookie_jar = CookieJar()
tagreader/web_handlers.py:167
- Launching Playwright with
channel="msedge"unconditionally is Windows/Edge-specific and will fail on macOS/Linux. Gate the channel selection by platform (or omitchanneloutside Windows) to keep the fallback auth path from crashing on non-Windows hosts.
with sync_playwright() as playwright:
browser = playwright.chromium.launch(headless=False, channel="msedge")
tagreader/web_handlers.py:71
browser_cookie3.edge()returns a CookieJar that doesn't supportlen(), solen(cookies) == 0will raiseTypeErrorat runtime. Convert the jar to a list (or useany(...)) before checking emptiness.
This issue also appears on line 82 of the same file.
def f5_check_browser_cookie():
cookies = browser_cookie3.edge(domain_name=".equinor.com")
if len(cookies) == 0:
raise ConnectionError(
"No cookies found for .piwebapi.equinor.com. Please log in to the F5 VPN using Microsoft Edge and try again."
tagreader/web_handlers.py:163
STATE_FILEis written to the current working directory, which can be read-only (services/containers) and is easy to accidentally leak even with.gitignore. Store it under a user-scoped directory and ensure it exists.
This issue also appears on line 166 of the same file.
def ensure_f5_authenticated_context():
STATE_FILE = Path(f"f5_{get_user_name()}_piwebapi_session.json")
tagreader/web_handlers.py:199
get_auth_pi()can return cookie-based auth objects (Cookie/CookieJar/list of cookie dicts), but the return annotation only includesHTTPKerberosAuthandBearerAuth. This is now incorrect and makes downstream typing misleading.
def get_auth_pi(use_internal: bool = True) -> Union[HTTPKerberosAuth, BearerAuth]:
tagreader/web_handlers.py:357
- On JSON decode failure this function returns
[], but callers treat the result as a dict (e.g.,...webid_dict()[datasource]), which will raiseTypeError. Return{}instead. (Also, the function’s return annotation currently indicates a list; it should match the dict returned on the success path.)
return []
asmfstatoilforce-pushed
the
radix_preparation
branch
from
August 19, 2026 22:04
84cde71 to
cab3c17Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.