abc-classroom.auth

abcclassroom.auth.check_or_generate_token()[source]

Check that a valid access token exists for the GitHub API and generates if one does not exist.

First tries local token file for valid token. If token does not exist or is not valid, generates a new one.

abcclassroom.auth.get_github_auth()[source]

Check to see if there is an existing github authentication and load the authentication.

Returns

Yaml object that contains the token and id for a github session. If yaml doesn’t exists, return an empty dictionary.

Return type

ruamel.yaml.comments.CommentedMap

abcclassroom.auth.set_github_auth(auth_info)[source]

Set the github authentication information. Put the token and id authentication information into a yaml file if it doesn’t already exist.

Parameters

auth_info (dictionary) – The token and id authentication information from github stored in a dictionary object.