Skip to content

Commit

Permalink
Merge pull request #16 from scientist-softserv/deploy-oauth-config
Browse files Browse the repository at this point in the history
deploy oauth config file
  • Loading branch information
bkiahstroud authored Jul 26, 2024
2 parents ad4e76b + 340605a commit 1058537
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ RAILS_DB_HOST=postgres
RAILS_DB_PORT=5432
RAILS_DB_NAME=manifold_production
RAILS_REDIS_URL=redis://redis:6379

CAS_CLIENT_ID=AAABBBCCCDDDEEEFFF
CAS_CLIENT_SECRET=AAABBBCCCDDDEEEFFF
9 changes: 7 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@ on:

jobs:
deploy:
uses: scientist-softserv/actions/.github/workflows/[email protected]
secrets: inherit
runs-on: ubuntu-latest
steps:
- name: "Load secrets into OAuth config"
run: envsubst < api/config/oauth.tmpl.yml > api/config/oauth.yml;
- name: "Do deploy"
uses: scientist-softserv/actions/.github/workflows/[email protected]
secrets: inherit
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
FROM ruby:2.7.8 as manifold-api
RUN apt-get -o Acquire::Check-Valid-Until=false update
RUN apt-get install -y libicu-dev postgresql-client nano curl software-properties-common ghostscript \
vim less
vim less gettext

# We need Node and Mammoth for Word text ingestion
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
Expand All @@ -21,6 +21,7 @@ RUN sed -i '/<policy domain="coder" rights="none" pattern="PDF" \/>/d' \
COPY api /opt/manifold/api
WORKDIR /opt/manifold/api
ENV RAILS_LOG_TO_STDOUT=1
RUN envsubst < config/oauth.tmpl.yml > config/oauth.yml
RUN gem install bundler:2.2.19
RUN bundle install
COPY bin/start-and-run /opt/manifold/api/start-and-run
Expand Down
28 changes: 28 additions & 0 deletions api/config/oauth.tmpl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
oauth:
cas:
client_id: $CAS_CLIENT_ID
client_secret: $CAS_CLIENT_SECRET
descriptive_name: Princeton CAS
host: fed.princeton.edu
protocol: https
email_key: 'mail'
name_key: 'displayname'
nickname_key: 'givenname'
uid_key: 'campusid'
# WARN: The values below are placeholders
endpoints:
authorize:
uri: '/cas/login'
method: 'GET'
query:
another: 'param'
token:
uri: '/oauth/token'
method: 'POST'
query:
another: 'param'
userinfo:
uri: '/api/v1/me'
method: 'GET'
query:
another: 'param'

0 comments on commit 1058537

Please sign in to comment.