Skip to content

Commit

Permalink
personal access tokens can have plus and slash
Browse files Browse the repository at this point in the history
  • Loading branch information
andylytical committed Jan 11, 2024
1 parent be2a365 commit c5b3860
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions jiracmdline/libjira.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def jira_login( token=None, username=None, passwd=None ):
'validate': True,
}
if token:
# logr.debug( f'Login using token from params' )
logr.info( f'Login using token from params' )
logr.debug( f"Got token '{token}' from params" )
params[ 'token_auth' ] = token
elif username and passwd:
logr.debug( f'Login using usr/pwd form params' )
logr.debug( f'Login using usr/pwd from params' )
params[ 'basic_auth' ] = ( username, passwd )
else:
# attempt to get username & passwd from netrc file
Expand All @@ -33,7 +33,8 @@ def jira_login( token=None, username=None, passwd=None ):
# if "account" is defined, assume it is a Personal Access Token
# prefer token over username/passwd
if account:
logr.debug( f'Login using account (token) from .netrc' )
logr.info( f"Using token from .netrc" )
logr.debug( f"Got token '{account}' from .netrc" )
params[ 'token_auth' ] = account
else:
logr.debug( f'Login using usr/pwd from .netrc' )
Expand Down
2 changes: 1 addition & 1 deletion jiracmdline/libweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def sanitize_key( key ):

def sanitize_val( val ):
temp = re.sub( ',', ' ', val )
return re.sub( '[^\r\n a-zA-Z0-9_()-]', '', temp )
return re.sub( '[^\r\n a-zA-Z0-9_()-+/]', '', temp )


def sanitize_dict( dirty ):
Expand Down

0 comments on commit c5b3860

Please sign in to comment.