Skip to content

Add information about AuthContext context class with link to api doc #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 1, 2023
Merged
40 changes: 40 additions & 0 deletions .github/workflows/publish-to-readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Publish Docs"

on:
# Auto-trigger this workflow on tag creation
push:
tags:
- 'v*.*.*'
# Auto-trigger this workflow on merge to main changes in docs/** folder
pull_request_target:
types:
- closed
branches:
- main
paths:
- 'docs/**'

env:
RTDS_ADS_PROJECT: https://readthedocs.org/api/v3/projects/accelerated-data-science
RTDS_ADS_TOKEN: ${{ secrets.RTDS_ADS_TOKEN }}

jobs:
build-n-publish:
name: Build and publish Docs 📖 to Readthedocs
runs-on: ubuntu-latest

steps:
- name: When PR ✅ merged - Trigger Readthedocs build
if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == true
run: |
curl \
-X POST \
-H "Authorization: Token $RTDS_ADS_TOKEN" $RTDS_ADS_PROJECT/versions/latest/builds/
- name: When tag 🏷️ pushed - Trigger Readthedocs build
if: github.event_name == 'push' && startsWith(github.ref_name, 'v')
run: |
# add 10 minutes wait time for readthedocs see freshly created tag
sleep 10m
curl \
-X POST \
-H "Authorization: Token $RTDS_ADS_TOKEN" $RTDS_ADS_PROJECT/versions/${{ github.ref_name }}/builds/
5 changes: 1 addition & 4 deletions .github/workflows/run-unittests-default_setup.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: tests/unitary/default_setup/**

on:
push:
pull_request:
branches:
- main
- 'release/**'
Expand All @@ -10,9 +10,6 @@ on:
- 'ads/**'
- setup.py
- '**requirements.txt'
- '!docs/**'

pull_request:

# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/run-unittests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: tests/unitary/**

on:
push:
pull_request:
branches:
- main
- 'release/**'
Expand All @@ -10,9 +10,6 @@ on:
- 'ads/**'
- setup.py
- '**requirements.txt'
- '!docs/**'

pull_request:

# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
Expand Down Expand Up @@ -163,7 +160,7 @@ jobs:
# Calculate overall coverage and update body message
COV=$(grep -E 'pc_cov' htmlcov/index.html | cut -d'>' -f 2 | cut -d'%' -f 1)
if [[ ! -z $COV ]]; then
if [[ $COV < 50 ]]; then COLOR=red; elif [[ $COV < 80 ]]; then COLOR=yellow; else COLOR=green; fi
if [[ $COV -lt 50 ]]; then COLOR=red; elif [[ $COV -lt 80 ]]; then COLOR=yellow; else COLOR=green; fi
echo COV_BODY="$COV_BODY_INTRO ![Coverage-$COV%](https://img.shields.io/badge/coverage-$COV%25-$COLOR)" >> $GITHUB_ENV
fi

Expand All @@ -174,7 +171,7 @@ jobs:

# Prepare default diff body text
DIFF_BODY_INTRO="📌 Cov diff with **${{ env.COMPARE_BRANCH }}**:\n\n"
echo DIFF_BODY="$BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
echo DIFF_BODY="$DIFF_BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV

# Prepare file paths to coverage xml files
# Filenames taken from job.test last step with name - "Save coverage files"
Expand All @@ -193,7 +190,7 @@ jobs:
--compare-branch=origin/${{ env.COMPARE_BRANCH }} | grep "No lines");
echo DIFF_BODY="$DIFF_BODY_INTRO $DIFF_INFO">> $GITHUB_ENV
else
if [[ $DIFF < 50 ]]; then COLOR=red; elif [[ $DIFF < 80 ]]; then COLOR=yellow; else COLOR=green; fi
if [[ $DIFF -lt 50 ]]; then COLOR=red; elif [[ $DIFF -lt 80 ]]; then COLOR=yellow; else COLOR=green; fi
echo DIFF_BODY="$DIFF_BODY_INTRO ![Coverage-$DIFF%](https://img.shields.io/badge/coverage-$DIFF%25-$COLOR)" >> $GITHUB_ENV
fi

Expand Down
2 changes: 2 additions & 0 deletions docs/source/user_guide/configuration/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ In the this example, the default authentication uses API keys specified with the
set_auth("api_key") # default signer is set to api_key
os_auth = authutil.resource_principal() # use resource principal to as the preferred way to access object store

``AuthContext`` context class can also be used to specify the desired type of authentication. It supports API key configuration, resource principal, and instance principal authentication, as well as predefined signers, callable signers, or API keys configurations from specified locations. See `API Documentation <../../ads.common.html#ads.common.auth.AuthContext>`__ for more details.