Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/875.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use pep8-compliant pyparsing references
1 change: 1 addition & 0 deletions doc/changelog.d/878.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prepare 2.3.1 release
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "ansys-openapi-common"
description = "Provides a helper to create sessions for use with Ansys OpenAPI clients."
version = "2.3.0"
version = "2.3.1"
license = "MIT"
authors = ["ANSYS, Inc. <pyansys.core@ansys.com>"]
maintainers = ["ANSYS, Inc. <pyansys.core@ansys.com>"]
Expand Down
9 changes: 4 additions & 5 deletions src/ansys/openapi/common/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
)

import pyparsing as pp
from pyparsing import Word
import requests
from requests.structures import CaseInsensitiveDict

Expand Down Expand Up @@ -137,17 +136,17 @@ def __init__(self) -> None:
token68_char = "-._~+/" + pp.nums + pp.alphas

token = pp.Word(token_char)
token68 = pp.Combine(pp.Word(token68_char) + pp.ZeroOrMore(Word("=")))
token68 = pp.Combine(pp.Word(token68_char) + pp.ZeroOrMore(pp.Word("=")))

name = pp.Word(pp.alphas, pp.alphanums)
value = pp.quotedString.setParseAction(pp.removeQuotes)
value = pp.quoted_string.set_parse_action(pp.remove_quotes)
name_value_pair = name + pp.Suppress("=") + value

params = pp.Dict(pp.delimitedList(pp.Group(name_value_pair)))
params = pp.Dict(pp.delimited_list(pp.Group(name_value_pair)))

credentials = token + (params ^ token68) ^ token

self.auth_parser = pp.delimitedList(credentials("schemes*"), delim=", ")
self.auth_parser = pp.delimited_list(credentials("schemes*"), delim=", ")

def parse_header(self, value: str) -> CaseInsensitiveOrderedDict:
"""Parse a given header's content and return a dictionary of authentication methods and parameters or tokens.
Expand Down