Skip to content

Commit

Permalink
Merge pull request #185 from carlmontanari/develop
Browse files Browse the repository at this point in the history
Fix Weekly Build && Prep 2022.01.30a1 pre-release to unblock some cfg things!
  • Loading branch information
carlmontanari authored Oct 3, 2021
2 parents b388516 + 56acf14 commit 530eacc
Show file tree
Hide file tree
Showing 82 changed files with 1,428 additions and 538 deletions.
6 changes: 2 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
interval: "monthly"
timezone: "PST8PDT"
time: "03:00"
target-branch: "develop"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
interval: "monthly"
timezone: "PST8PDT"
time: "03:00"
target-branch: "develop"
9 changes: 7 additions & 2 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ jobs:
TERM: xterm
run: python -m nox -s unit_tests
- name: Upload coverage
uses: codecov/codecov-action@v2.0.2
uses: codecov/codecov-action@v2.1.0

build_posix:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
os: [ubuntu-latest, macos-latest]
version: [3.6, 3.7, 3.8, 3.9, 3.10.0-beta.4]
version: [3.6, 3.7, 3.8, 3.9, 3.10.0-rc.2]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand All @@ -67,6 +67,11 @@ jobs:
# version we are targeting with nox, while still having versions like 3.9.0a4
run: |
echo "FRIENDLY_PYTHON_VERSION=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")" >> $GITHUB_ENV
- name: ensure openssl installed for macos
# openssl missing/being linked incorrectly causes ssh2-python install failures
if: matrix.os == 'macos-latest'
run: |
brew install openssl
- name: setup test env
run: |
python -m pip install --upgrade pip
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
max-parallel: 12
matrix:
os: [ubuntu-latest, macos-latest]
version: [3.6, 3.7, 3.8, 3.9, 3.10.0-beta.4]
version: [3.6, 3.7, 3.8, 3.9, 3.10.0-rc.2]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand All @@ -46,6 +46,11 @@ jobs:
# version we are targeting with nox, while still having versions like 3.9.0a4
run: |
echo "FRIENDLY_PYTHON_VERSION=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")" >> $GITHUB_ENV
- name: ensure openssl installed for macos
# openssl missing/being linked incorrectly causes ssh2-python install failures
if: matrix.os == 'macos-latest'
run: |
brew install openssl
- name: setup test env
run: |
python -m pip install --upgrade pip
Expand Down
68 changes: 38 additions & 30 deletions docs/api_docs/channel/async_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,11 @@ class AsyncChannel(BaseChannel):
passphrase_count = 0
authenticate_buf = b""

search_pattern = self._get_prompt_pattern(
class_pattern=self._base_channel_args.comms_prompt_pattern
)
(
password_pattern,
passphrase_pattern,
prompt_pattern,
) = self._pre_channel_authenticate_ssh()

async with self._channel_lock():
while True:
Expand All @@ -330,7 +332,10 @@ class AsyncChannel(BaseChannel):
buf = b""
authenticate_buf += buf.lower()

if b"password" in authenticate_buf:
if re.search(
pattern=password_pattern,
string=authenticate_buf,
):
# clear the authentication buffer so we don't re-read the password prompt
authenticate_buf = b""
password_count += 1
Expand All @@ -341,7 +346,10 @@ class AsyncChannel(BaseChannel):
self.write(channel_input=auth_password, redacted=True)
self.send_return()

if b"enter passphrase for key" in authenticate_buf:
if re.search(
pattern=passphrase_pattern,
string=authenticate_buf,
):
# clear the authentication buffer so we don't re-read the passphrase prompt
authenticate_buf = b""
passphrase_count += 1
Expand All @@ -352,12 +360,10 @@ class AsyncChannel(BaseChannel):
self.write(channel_input=auth_private_key_passphrase, redacted=True)
self.send_return()

channel_match = re.search(
pattern=search_pattern,
if re.search(
pattern=prompt_pattern,
string=authenticate_buf,
)

if channel_match:
):
return

@ChannelTimeout(message="timed out during in channel telnet authentication")
Expand Down Expand Up @@ -441,12 +447,10 @@ class AsyncChannel(BaseChannel):
self.write(channel_input=auth_password, redacted=True)
self.send_return()

channel_match = re.search(
if re.search(
pattern=prompt_pattern,
string=authenticate_buf,
)

if channel_match:
):
return

@ChannelTimeout(message="timed out getting prompt")
Expand Down Expand Up @@ -999,9 +1003,11 @@ class AsyncChannel(BaseChannel):
passphrase_count = 0
authenticate_buf = b""

search_pattern = self._get_prompt_pattern(
class_pattern=self._base_channel_args.comms_prompt_pattern
)
(
password_pattern,
passphrase_pattern,
prompt_pattern,
) = self._pre_channel_authenticate_ssh()

async with self._channel_lock():
while True:
Expand All @@ -1011,7 +1017,10 @@ class AsyncChannel(BaseChannel):
buf = b""
authenticate_buf += buf.lower()

if b"password" in authenticate_buf:
if re.search(
pattern=password_pattern,
string=authenticate_buf,
):
# clear the authentication buffer so we don't re-read the password prompt
authenticate_buf = b""
password_count += 1
Expand All @@ -1022,7 +1031,10 @@ class AsyncChannel(BaseChannel):
self.write(channel_input=auth_password, redacted=True)
self.send_return()

if b"enter passphrase for key" in authenticate_buf:
if re.search(
pattern=passphrase_pattern,
string=authenticate_buf,
):
# clear the authentication buffer so we don't re-read the passphrase prompt
authenticate_buf = b""
passphrase_count += 1
Expand All @@ -1033,12 +1045,10 @@ class AsyncChannel(BaseChannel):
self.write(channel_input=auth_private_key_passphrase, redacted=True)
self.send_return()

channel_match = re.search(
pattern=search_pattern,
if re.search(
pattern=prompt_pattern,
string=authenticate_buf,
)

if channel_match:
):
return

@ChannelTimeout(message="timed out during in channel telnet authentication")
Expand Down Expand Up @@ -1122,12 +1132,10 @@ class AsyncChannel(BaseChannel):
self.write(channel_input=auth_password, redacted=True)
self.send_return()

channel_match = re.search(
if re.search(
pattern=prompt_pattern,
string=authenticate_buf,
)

if channel_match:
):
return

@ChannelTimeout(message="timed out getting prompt")
Expand Down Expand Up @@ -1391,7 +1399,7 @@ class AsyncChannel(BaseChannel):


##### channel_authenticate_ssh
`channel_authenticate_ssh(self, auth_password: str, auth_private_key_passphrase: str) ‑> NoneType`
`channel_authenticate_ssh(self, auth_password: str, auth_private_key_passphrase: str) ‑> None`

```text
Handle SSH Authentication for transports that only operate "in the channel" (i.e. system)
Expand All @@ -1413,7 +1421,7 @@ Raises:


##### channel_authenticate_telnet
`channel_authenticate_telnet(self, auth_username: str = '', auth_password: str = '') ‑> NoneType`
`channel_authenticate_telnet(self, auth_username: str = '', auth_password: str = '') ‑> None`

```text
Handle Telnet Authentication
Expand Down
Loading

0 comments on commit 530eacc

Please sign in to comment.