Skip to content

Commit 2f3af7f

Browse files
committed
Fixes
1 parent 260544d commit 2f3af7f

File tree

5 files changed

+44
-7
lines changed

5 files changed

+44
-7
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import argparse
2+
from COMPS import Client
3+
from COMPS.CredentialPrompt import CredentialPrompt
4+
5+
6+
class StaticCredentialPrompt(CredentialPrompt):
7+
def __init__(self, comps_url, username, password):
8+
if (comps_url is None) or (username is None) or (password is None):
9+
print("Usage: python create_auth_token_args.py --comps_url url --username username --password pwd")
10+
print("\n")
11+
raise RuntimeError('Missing comps_url, or username or password')
12+
self._times_prompted = 0
13+
self.comps_url = comps_url
14+
self.username = username
15+
self.password = password
16+
17+
def prompt(self):
18+
print("logging in with hardcoded user/pw")
19+
self._times_prompted = self._times_prompted + 1
20+
if self._times_prompted > 3:
21+
raise RuntimeError('Failure authenticating')
22+
print("Hit here")
23+
return {'Username': self.username, 'Password': self.password}
24+
25+
26+
if __name__ == '__main__':
27+
parser = argparse.ArgumentParser()
28+
29+
parser.add_argument('--comps_url', default='https://comps2.idmod.org', help='comps url')
30+
parser.add_argument('--username', help='enter username')
31+
parser.add_argument('--password', help='enter password')
32+
33+
args = parser.parse_args()
34+
35+
compshost = args.comps_url
36+
37+
Client.login(compshost, StaticCredentialPrompt(comps_url=args.comps_url, username=args.username, password=args.password))

.github/workflows/mkdocs_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
python-version: '3.x'
2222
- name: Install packages
2323
run: |
24-
python3 -m pip install --upgrade pip
25-
python3 -m pip install .[docs]
24+
python -m pip install --upgrade pip
25+
python -m pip install .[docs]
2626
- name: Build static files
2727
run: |
2828
mkdocs build

.github/workflows/mkdocs_deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
python-version: '3.x'
2222
- name: Install packages
2323
run: |
24-
python3 -m pip install --upgrade pip
25-
python3 -m pip install .[docs]
24+
python -m pip install --upgrade pip
25+
python -m pip install .[docs]
2626
- name: Build static files
2727
run: |
2828
mkdocs build -d site

.github/workflows/publish_pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
python-version: '3.x'
1818
- name: Build
1919
run: |
20-
python3 -m pip install build --user
21-
python3 -m build
20+
python -m pip install build --user
21+
python -m build
2222
- name: Store packages
2323
uses: actions/upload-artifact@v6
2424
with:

.github/workflows/tests_comps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
python -m pip install .[test]
4242
- name: Login to COMPS2
4343
run: |
44-
python .dev_scripts/create_auth_token_args.py --username ${{ secrets.COMPS_USER }} --password ${{ secrets.COMPS_PASSWORD }}
44+
python .github/python/create_auth_token_args.py --username ${{ secrets.COMPS_USER }} --password ${{ secrets.COMPS_PASSWORD }}
4545
env:
4646
COMPS_USER: ${{ secrets.COMPS_USER }}
4747
COMPS_PASSWORD: ${{ secrets.COMPS_PASSWORD }}

0 commit comments

Comments
 (0)