Skip to content

Commit 551cd23

Browse files
committed
Update to fail on sphinx errors.
1 parent 25d76a8 commit 551cd23

File tree

8 files changed

+73
-6
lines changed

8 files changed

+73
-6
lines changed

chevah/__init__.py

Whitespace-only changes.

chevah/server/__init__.py

Whitespace-only changes.

chevah/server/extension/__init__.py

Whitespace-only changes.
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright (c) 2021 Adi Roiban.
2+
# See LICENSE for details.
3+
"""
4+
Extensions to add custom MFA to SFTPPlus LDAP authentication.
5+
"""
6+
from __future__ import unicode_literals
7+
8+
9+
class AuthLDAPNoop(object):
10+
"""
11+
This is an LDAP authentication extension that has no extra functionality.
12+
13+
It servers as a documentation for the extension interface.
14+
15+
The extension is implicitly started at initialization.
16+
"""
17+
18+
def __init__(self, configuration):
19+
"""
20+
Called when the associated LDAP authentication starts.
21+
22+
:param configuration: A text which can be formatted as JSON.
23+
But each extension can parse it as it wants.
24+
JSON format is not required. It is only recommended.
25+
"""
26+
27+
def stop(self):
28+
"""
29+
Called when the extension is no longer used.
30+
"""
31+
32+
def updateCredentials(self, credentials):
33+
"""
34+
Called before BIND to allow mutating the credentials.
35+
36+
This can be used to mutate the credentials to be used during the
37+
BIND operation.
38+
"""
39+
40+
def getExtraAttributes(self):
41+
"""
42+
Return the list of extra LDAP attributes to be used during the entry
43+
search operation.
44+
"""
45+
return []
46+
47+
def augmentEntry(self, entry, credentials, ldap_client):
48+
"""
49+
Called after BIND was successful and we got the LDAP entry for the
50+
account.
51+
52+
Raises
53+
chevah.server.commons.exception.ServerException
54+
on any error condition, with a text containing the error details.
55+
56+
:param entry: The LDAP entry that was just authenticated.
57+
:param credentials: Used for the authorization to LDAP server.
58+
:param ldap_client: A LDAP client that is already authenticated and
59+
that can be used for further LDAP operations.
60+
:param base_dn: The base_dn from which the account was authenticated.
61+
62+
:return: The augmented LDAP entry on success.
63+
"""
64+
return entry

netlify.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Netlify will auto install the deps.
1919
# https://docs.netlify.com/configure-builds/manage-dependencies/#python
2020
# https://github.com/netlify/build-image/blob/focal/included_software.md
21-
command = 'sphinx-build -b html -D html_theme=integrated -A robots="$DOCS_ROBOT" src/doc_source/ deploy'
21+
command = 'bash netlify_build.sh'
2222

2323
[build.processing.html]
2424
# The automatic redirection from /path/folder-> /path/folder/ is disabled

netlify_build.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Command to build the docs on netfliy.
2+
sphinx-build -b html --keep-going -W -D html_theme=integrated -A robots="$DOCS_ROBOT" src/doc_source/ deploy

src/doc_source/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
}
2929

3030

31-
version = "4.23.0.dev0"
32-
release = "4.23.0.dev0"
31+
version = "4.22.0"
32+
release = "4.22.0"
3333

3434
autodoc_default_flags = ['members']
3535
primary_domain = 'py'
3636

3737
pdf_documents = [(
3838
'index',
39-
u'SFTPPlus-4.23.0.dev0',
39+
u'SFTPPlus-4.22.0',
4040
u'SFTPPlus Documentation',
4141
u'ProAtria Team',
4242
)]

update-docs.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ cp -r build-server/doc_source $DOCS_ROOT/src/
1313
cp extension/* $DOCS_ROOT/extension/
1414
cp -r build-server/lib/python2.7/site-packages/sftpplus_website/sphinx $DOCS_ROOT
1515

16+
echo "Creating extensions for $DOCS_ROOT ..."
1617
mkdir -p $DOCS_ROOT/chevah/server/extension
1718
touch $DOCS_ROOT/chevah/__init__.py
1819
touch $DOCS_ROOT/chevah/server/__init__.py
@@ -21,11 +22,11 @@ cp chevah/server/extension/auth_ldap_noop.py $DOCS_ROOT/chevah/server/extension/
2122

2223
cd $DOCS_ROOT
2324
rm -rf venv/lib/python2.7/site-packages/chevah
24-
mv chevah venv/lib/python2.7/site-packages/
25+
cp -r chevah venv/lib/python2.7/site-packages/
2526
sed 's/^templates_path.*/templates_path = ["..\/..\/sphinx"]/'g -i src/doc_source/conf.py
2627
sed 's/^html_theme_path.*/html_theme_path = ["..\/..\/sphinx"]/'g -i src/doc_source/conf.py
2728

2829
rm -rf deploy
2930
. venv/bin/activate
3031
pip install -r requirements.txt
31-
sphinx-build -b html src/doc_source/ deploy
32+
sphinx-build -b html --keep-going -W src/doc_source/ deploy

0 commit comments

Comments
 (0)