Skip to content

Commit

Permalink
Removed more deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
tpazderka committed Aug 2, 2019
1 parent 2e751ed commit 3e64a2b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 51 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ The format is based on the [KeepAChangeLog] project.

### Removed
- [#671] Removed deprecated request/response_cls kwargs from Provider/Client methods
- [#677] Removed more deprecated code

[#671]: https://github.com/OpenIDC/pyoidc/pull/XXX
[#677]: https://github.com/OpenIDC/pyoidc/pull/677

## 1.0.1 [2019-06-30]

Expand Down
12 changes: 0 additions & 12 deletions src/oic/oic/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import logging
import socket
import time
import warnings
from functools import cmp_to_key
from typing import Dict # noqa
from typing import List # noqa
Expand Down Expand Up @@ -281,17 +280,6 @@ def __init__(
self.preferred_id_type = "public"
self.hostname = hostname or socket.gethostname()

self.register_endpoint = None
for endp in self.endp:
if endp.etype == "registration":
endpoint = urljoin(self.baseurl, endp.url)
warnings.warn(
"Using `register_endpoint` is deprecated, please use `registration_endpoint` instead.",
DeprecationWarning,
)
self.register_endpoint = endpoint
break

self.force_jws = {"request_object": False, "id_token": False, "userinfo": False}

self.jwx_def = {} # type: Dict[str, Dict[str,str]]
Expand Down
17 changes: 0 additions & 17 deletions src/oic/utils/authn/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import base64
import logging
import warnings
from urllib.parse import quote_plus

from jwkest import Invalid
Expand Down Expand Up @@ -256,22 +255,6 @@ def construct(self, cis, request_args=None, http_args=None, **kwargs):
return http_args


def bearer_auth(req, authn):
"""
Pick out the access token, either in HTTP_Authorization header or in request body.
:param req:
:param authn:
:return:
"""
warnings.warn("`bearer_auth` is deprecated.", DeprecationWarning, stacklevel=2)
try:
return req["access_token"]
except KeyError:
assert authn.startswith("Bearer ")
return authn[7:]


class JWSAuthnMethod(ClientAuthnMethod):
def choose_algorithm(self, entity, **kwargs):
try:
Expand Down
22 changes: 0 additions & 22 deletions src/oic/utils/http_util.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import base64
import cgi
import hashlib
import hmac
import logging
import os
import time
import warnings
from http import client
from http.cookies import SimpleCookie
from typing import Dict # noqa
Expand Down Expand Up @@ -222,26 +220,6 @@ def factory(code, message, **kwargs):
return R2C[code](message, **kwargs)


def extract(environ, empty=False, err=False):
"""
Extract strings in form data and returns a dict.
:param environ: WSGI environ
:param empty: Stops on empty fields (default: Fault)
:param err: Stops on errors in fields (default: Fault)
"""
warnings.warn("This function is deprecated.", DeprecationWarning)
formdata = cgi.parse(environ["wsgi.input"], environ, empty, err)
# Remove single entries from lists
new_formdata = {} # type: Dict[str, Union[str, List[str]]]
for key, value in formdata.items():
if len(value) == 1:
new_formdata[key] = value[0]
else:
new_formdata[key] = value
return new_formdata


def geturl(environ, query=True, path=True):
"""
Rebuild a request URL (from PEP 333).
Expand Down

0 comments on commit 3e64a2b

Please sign in to comment.