Skip to content

Commit d63f2a1

Browse files
authored
Merge pull request #117 from pvarki/akx_tyops_fix
Fix some typos (with crate-ci/typos + manual assistance)
2 parents 6128780 + 9d3f422 commit d63f2a1

20 files changed

+49
-49
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.6.2
2+
current_version = 1.6.3
33
commit = False
44
tag = False
55

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Example usage
172172

173173
```curl -L -H "Content-Type: application/json" -d '{ "request": {"hosts":["harjoitus1.pvarki.fi"], "names":[{"C":"FI", "ST":"Jyvaskyla", "L":"KeskiSuomi", "O":"harjoitus1.pvarki.fi"}], "CN": "harjoitus1.pvarki.fi"}, "bundle":true, "profile":"client"}' 127.0.0.1:8000/takreg | jq```
174174

175-
The cfssl used behind API listents this kind of stuff https://github.com/cloudflare/cfssl/blob/master/doc/api/endpoint_newcert.txt
175+
The cfssl used behind API listens this kind of stuff https://github.com/cloudflare/cfssl/blob/master/doc/api/endpoint_newcert.txt
176176

177177
# Enrollment - Enroll a new work_id
178178

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "rasenmaeher_api"
3-
version = "1.6.2"
3+
version = "1.6.3"
44
description = "python-rasenmaeher-api"
55
authors = [
66
"Aciid <703382+Aciid@users.noreply.github.com>",

src/rasenmaeher_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
""" python-rasenmaeher-api """
2-
__version__ = "1.6.2" # NOTE Use `bump2version --config-file patch` to bump versions correctly
2+
__version__ = "1.6.3" # NOTE Use `bump2version --config-file patch` to bump versions correctly

src/rasenmaeher_api/db/people.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from ..web.api.middleware.datatypes import MTLSorJWTPayload
2424
from .errors import NotFound, Deleted, BackendError, CallsignReserved
2525
from ..cfssl.private import sign_csr, revoke_pem, validate_reason, ReasonTypes, refresh_ocsp
26-
from ..prodcutapihelpers import post_to_all_products
26+
from ..productapihelpers import post_to_all_products
2727
from ..rmsettings import RMSettings
2828
from ..kchelpers import KCClient, KCUserData
2929
from .engine import EngineWrapper

src/rasenmaeher_api/kchelpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ async def _check_admin_role(self) -> None:
7575
if self._kc_admin_role:
7676
return
7777
ret = await self.kcadmin.a_get_realm_roles(search_text="admin")
78-
# If multipe roles match the search choose exact match
78+
# If multiple roles match the search choose exact match
7979
flt = [rolerep for rolerep in ret if rolerep["name"] == "admin"]
8080
if not flt:
8181
raise ValueError("KC has no configured 'admin' role")
8282
self._kc_admin_role = flt[0]
8383

8484
async def check_user_roles(self, user: KCUserData) -> bool:
85-
"""Chekc users roles in KC and update as needed, returns true if changes were made"""
85+
"""Check users roles in KC and update as needed, returns true if changes were made"""
8686
await self._check_admin_role()
8787
kc_roles = {role["name"]: role for role in await self.kcadmin.a_get_realm_roles_of_user(user.kc_id)}
8888
LOGGER.debug("Found KC roles: {} (user: {})".format(list(kc_roles.keys()), user.roles))

src/rasenmaeher_api/prodcutapihelpers.py renamed to src/rasenmaeher_api/productapihelpers.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,52 +23,52 @@ def check_kraftwerk_manifest() -> bool:
2323

2424

2525
async def post_to_all_products(
26-
url_suffix: str, data: Mapping[str, Any], respose_schema: Type[pydantic.BaseModel], collect_responses: bool = True
26+
url_suffix: str, data: Mapping[str, Any], response_schema: Type[pydantic.BaseModel], collect_responses: bool = True
2727
) -> Optional[Dict[str, Optional[pydantic.BaseModel]]]:
2828
"""Call given POST endpoint on all products in the manifest"""
29-
return await _method_to_all_products("post", url_suffix, data, respose_schema, collect_responses)
29+
return await _method_to_all_products("post", url_suffix, data, response_schema, collect_responses)
3030

3131

3232
async def put_to_all_products(
33-
url_suffix: str, data: Mapping[str, Any], respose_schema: Type[pydantic.BaseModel], collect_responses: bool = True
33+
url_suffix: str, data: Mapping[str, Any], response_schema: Type[pydantic.BaseModel], collect_responses: bool = True
3434
) -> Optional[Dict[str, Optional[pydantic.BaseModel]]]:
3535
"""Call given PUT endpoint on all products in the manifest"""
36-
return await _method_to_all_products("put", url_suffix, data, respose_schema, collect_responses)
36+
return await _method_to_all_products("put", url_suffix, data, response_schema, collect_responses)
3737

3838

3939
async def get_from_all_products(
40-
url_suffix: str, respose_schema: Type[pydantic.BaseModel], collect_responses: bool = True
40+
url_suffix: str, response_schema: Type[pydantic.BaseModel], collect_responses: bool = True
4141
) -> Optional[Dict[str, Optional[pydantic.BaseModel]]]:
4242
"""Call given GET endpoint on all products in the manifest"""
43-
return await _method_to_all_products("get", url_suffix, None, respose_schema, collect_responses)
43+
return await _method_to_all_products("get", url_suffix, None, response_schema, collect_responses)
4444

4545

4646
async def get_from_product(
47-
name: str, url_suffix: str, respose_schema: Type[pydantic.BaseModel]
47+
name: str, url_suffix: str, response_schema: Type[pydantic.BaseModel]
4848
) -> Optional[pydantic.BaseModel]:
4949
"""Call given GET endpoint on named product in the manifest"""
50-
return await _method_to_product(name, "get", url_suffix, None, respose_schema)
50+
return await _method_to_product(name, "get", url_suffix, None, response_schema)
5151

5252

5353
async def post_to_product(
54-
name: str, url_suffix: str, data: Mapping[str, Any], respose_schema: Type[pydantic.BaseModel]
54+
name: str, url_suffix: str, data: Mapping[str, Any], response_schema: Type[pydantic.BaseModel]
5555
) -> Optional[pydantic.BaseModel]:
5656
"""Call given POST endpoint on named product in the manifest"""
57-
return await _method_to_product(name, "post", url_suffix, data, respose_schema)
57+
return await _method_to_product(name, "post", url_suffix, data, response_schema)
5858

5959

6060
async def put_to_product(
61-
name: str, url_suffix: str, data: Mapping[str, Any], respose_schema: Type[pydantic.BaseModel]
61+
name: str, url_suffix: str, data: Mapping[str, Any], response_schema: Type[pydantic.BaseModel]
6262
) -> Optional[pydantic.BaseModel]:
6363
"""Call given PUT endpoint on named product in the manifest"""
64-
return await _method_to_product(name, "put", url_suffix, data, respose_schema)
64+
return await _method_to_product(name, "put", url_suffix, data, response_schema)
6565

6666

6767
async def _method_to_all_products(
6868
methodname: str,
6969
url_suffix: str,
7070
data: Optional[Mapping[str, Any]],
71-
respose_schema: Type[pydantic.BaseModel],
71+
response_schema: Type[pydantic.BaseModel],
7272
collect_responses: bool = True,
7373
) -> Optional[Dict[str, Optional[pydantic.BaseModel]]]:
7474
"""Call given POST endpoint on call products in the manifest"""
@@ -83,9 +83,9 @@ async def _method_to_all_products(
8383

8484
async def handle_one(name: str) -> Tuple[str, Optional[pydantic.BaseModel]]:
8585
"""Do one call"""
86-
nonlocal url_suffix, methodname, respose_schema, data
86+
nonlocal url_suffix, methodname, response_schema, data
8787
try:
88-
return name, await _method_to_product(name, methodname, url_suffix, data, respose_schema)
88+
return name, await _method_to_product(name, methodname, url_suffix, data, response_schema)
8989
except Exception as exc: # pylint: disable=W0718
9090
LOGGER.exception(exc)
9191
return name, None
@@ -107,7 +107,7 @@ async def _method_to_product(
107107
methodname: str,
108108
url_suffix: str,
109109
data: Optional[Mapping[str, Any]],
110-
respose_schema: Type[pydantic.BaseModel],
110+
response_schema: Type[pydantic.BaseModel],
111111
) -> Optional[Optional[pydantic.BaseModel]]:
112112
"""Do a call to named product"""
113113

@@ -130,7 +130,7 @@ async def _method_to_product(
130130
resp.raise_for_status()
131131
payload = await resp.json()
132132
LOGGER.debug("{}({}) payload={}".format(methodname, url, payload))
133-
retval = respose_schema.parse_obj(payload)
133+
retval = response_schema.parse_obj(payload)
134134
# Log a common error case here for DRY
135135
if isinstance(retval, OperationResultResponse):
136136
if not retval.success:

src/rasenmaeher_api/rmsettings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Config: # pylint: disable=too-few-public-methods
7171
test_api_client_cert_header_value: str = "CN=fake.localmaeher.dev.pvarki.fi,O=N/A"
7272
api_healthcheck_proto: str = "http://"
7373
api_healthcheck_url: str = "/api/v1/healthcheck"
74-
api_healthcheck_headers: str = '{"propably":"not_needed"}'
74+
api_healthcheck_headers: str = '{"probably":"not_needed"}'
7575

7676
# Sentry's configuration.
7777
sentry_dsn: Optional[str] = None

src/rasenmaeher_api/web/api/descriptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pydantic import BaseModel, Extra, Field
77
from pydantic_collections import BaseCollectionModel
88

9-
from ...prodcutapihelpers import get_from_all_products, get_from_product
9+
from ...productapihelpers import get_from_all_products, get_from_product
1010

1111

1212
LOGGER = logging.getLogger(__name__)

src/rasenmaeher_api/web/api/firstuser/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Config: # pylint: disable=too-few-public-methods
1616
{
1717
"name": "normal",
1818
"summary": "Description text",
19-
"description": "This containts **description** of values.",
19+
"description": "This contains **description** of values.",
2020
"value": {"temp_admin_code": "[str] - temporary init admin users string"},
2121
},
2222
{
@@ -60,7 +60,7 @@ class Config: # pylint: disable=too-few-public-methods
6060
{
6161
"name": "normal",
6262
"summary": "Description text",
63-
"description": "This containts **description** of values.",
63+
"description": "This contains **description** of values.",
6464
"value": {
6565
"callsign": "[str] - id/name for new user that is elevated to admin",
6666
},

0 commit comments

Comments
 (0)