Skip to content

Commit a46fb7f

Browse files
committed
Merge branch '8.0.x' of https://github.com/macite/doubtfire-api into 8.0.x
2 parents 4dee4d7 + ecc2899 commit a46fb7f

File tree

4 files changed

+39
-13
lines changed

4 files changed

+39
-13
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ Doubtfire requires multiple environment variables that help define settings abou
3232
| `DF_AUTH_METHOD` | The authentication method you would like Doubtfire to use. Possible values are `database` for standard authentication with the database, `ldap` | `database` |
3333
| | for [LDAP](https://www.freebsd.org/doc/en/articles/ldap-auth/), `aaf` for [AAF Rapid Connect](https://rapid.aaf.edu.au/), or `SAML2` for [SAML2.0 auth](https://en.wikipedia.org/wiki/SAML_2.0). | |
3434
| `DF_STUDENT_WORK_DIR` | The directory to store uploaded student work for processing. | `student_work` |
35-
| `DF_ARCHIVE_DIR` | The directory to move archived unit files to, and access from. | `DF_STUDENT_WORK_DIR/archive` |
36-
| `DF_INSTITUTION_NAME` | The name of your institution running Doubtfire. | _University of Foo_ |
35+
| `DF_ARCHIVE_DIR` | The directory to move archived unit files to, and access from. | `DF_STUDENT_WORK_DIR/archive` |
36+
| `DF_INSTITUTION_NAME` | The name of your institution running Doubtfire. | _Doubtfire University_ |
3737
| `DF_INSTITUTION_EMAIL_DOMAIN` | The email domain from which emails are sent to and from in your institution. | `doubtfire.com` |
3838
| `DF_INSTITUTION_HOST` | The host running the Doubtfire instance. | `localhost:3000` |
3939
| `DF_INSTITUTION_PRODUCT_NAME` | The name of the product (i.e. Doubtfire) at your institution. | _Doubtfire_ |
40+
| `DF_INSTITUTION_HAS_LOGO` | Set to true (or 1) if there is an associated institution logo to be included in the header. | false |
41+
| `DF_INSTITUTION_LOGO_URL` | The url of the logo to include in the header if there is a logo. | /assets/images/institution-logo.png |
42+
| `DF_INSTITUTION_LOGO_LINK_URL` | The url used for the hyperlink associated with clicking the logo. | / |
4043
| `DF_SECRET_KEY_BASE` | The Rails secret key. | Default key provided. |
4144
| `DF_SECRET_KEY_ATTR` | The secret key to encrypt certain database fields. | Default key provided. |
4245
| `DF_SECRET_KEY_DEVISE` | The secret key provided to Devise. | Default key provided. |
@@ -78,6 +81,18 @@ If you have chosen to use AAF Rapid Connect authentication, then you will also n
7881
| `DF_AAF_AUTH_SIGNOUT_URL` | The URL to redirect to on sign out in order to log out of AAF Rapid Connect. | No default - required |
7982
| `DF_SECRET_KEY_AAF` | The secret used to register your application with AAF. | `secretsecret12345` |
8083

84+
If you are authenticating using SAML2, then you will also need to provide the following:
85+
86+
| Key | Description | Default |
87+
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
88+
| `DF_SAML_METADATA_URL` | The URL to getch the SAML metadata. | No default |
89+
| `DF_SAML_CONSUMER_SERVICE_URL` | The URL of the AAF registered application. | No default - required |
90+
| `DF_AAF_CALLBACK_URL` | The secure endpoint within your application that AAF Rapid Connect should POST responses to. It **must end with `/api/auth/jwt`** to access the Doubtfire JWT authentication endpoint. | No default - required |
91+
| `DF_AAF_UNIQUE_URL` | The unique URL provided by AAF Rapid Connect used for redirection out of Doubtfire. | No default - required |
92+
| `DF_AAF_IDENTITY_PROVIDER_URL` | The URL of the AAF-registered identity provider. | No default - required |
93+
| `DF_AAF_AUTH_SIGNOUT_URL` | The URL to redirect to on sign out in order to log out of AAF Rapid Connect. | No default - required |
94+
| `DF_SECRET_KEY_AAF` | The secret used to register your application with AAF. | `secretsecret12345` |
95+
8196
You may choose to keep your environment variables inside a `.env` file using key-value pairs:
8297

8398
```

app/api/settings_api.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ class SettingsApi < Grape::API
88
get '/settings' do
99
response = {
1010
externalName: Doubtfire::Application.config.institution[:product_name],
11+
hasLogo: Doubtfire::Application.config.institution[:has_logo],
12+
logoUrl: Doubtfire::Application.config.institution[:logo_url],
13+
logoLinkUrl: Doubtfire::Application.config.institution[:logo_link_url],
1114
overseerEnabled: Doubtfire::Application.config.overseer_enabled,
1215
tiiEnabled: TurnItIn.enabled?,
1316
d2lEnabled: D2lIntegration.enabled?

config/application.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ def self.fetch_boolean_env(name)
7474
config.institution[:email_domain] = ENV['DF_INSTITUTION_EMAIL_DOMAIN'] if ENV['DF_INSTITUTION_EMAIL_DOMAIN']
7575
config.institution[:host] = ENV['DF_INSTITUTION_HOST'] if ENV['DF_INSTITUTION_HOST']
7676
config.institution[:product_name] = ENV['DF_INSTITUTION_PRODUCT_NAME'] if ENV['DF_INSTITUTION_PRODUCT_NAME']
77+
78+
config.institution[:has_logo] = (ENV['DF_INSTITUTION_HAS_LOGO'].to_s.downcase == "true" || ENV['DF_INSTITUTION_HAS_LOGO'].to_i == 1) if ENV['DF_INSTITUTION_HAS_LOGO']
79+
config.institution[:logo_url] = ENV['DF_INSTITUTION_LOGO_URL'] if ENV['DF_INSTITUTION_LOGO_URL']
80+
config.institution[:logo_link_url] = ENV['DF_INSTITUTION_LOGO_LINK_URL'] if ENV['DF_INSTITUTION_LOGO_LINK_URL']
81+
7782
config.institution[:privacy] = ENV['DF_INSTITUTION_PRIVACY'] if ENV['DF_INSTITUTION_PRIVACY']
7883
config.institution[:plagiarism] = ENV['DF_INSTITUTION_PLAGIARISM'] if ENV['DF_INSTITUTION_PLAGIARISM']
7984
# Institution host becomes localhost in development
@@ -113,11 +118,11 @@ def self.fetch_boolean_env(name)
113118
config.saml[:entity_id].nil? ||
114119
config.saml[:idp_sso_target_url].nil?
115120
raise "Invalid values specified to saml, check the following environment variables: \n " \
116-
"key => variable set?\n " \
117-
"DF_SAML_CONSUMER_SERVICE_URL => #{!ENV['DF_SAML_CONSUMER_SERVICE_URL'].nil?}\n " \
121+
"key => variable set?\n " \
122+
"DF_SAML_CONSUMER_SERVICE_URL => #{!ENV['DF_SAML_CONSUMER_SERVICE_URL'].nil?}\n " \
118123
"DF_SAML_SP_ENTITY_ID => #{!ENV['DF_SAML_SP_ENTITY_ID'].nil?}\n " \
119-
"DF_SAML_IDP_SIGNOUT_URL => #{!ENV['DF_SAML_IDP_SIGNOUT_URL'].nil?}\n " \
120-
"DF_SAML_IDP_TARGET_URL => #{!ENV['DF_SAML_IDP_TARGET_URL'].nil?}\n"
124+
"DF_SAML_IDP_SIGNOUT_URL => #{!ENV['DF_SAML_IDP_SIGNOUT_URL'].nil?}\n " \
125+
"DF_SAML_IDP_TARGET_URL => #{!ENV['DF_SAML_IDP_TARGET_URL'].nil?}\n"
121126
end
122127

123128
# If there's no XML url, we need the cert

config/institution.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
name: Doubtfire University
2-
email_domain: doubtfire.com
3-
host: localhost:3000
4-
product_name: Doubtfire
5-
settings: no_institution_setting.rb
6-
privacy: By clicking on the Upload button, I certify that the attached work is entirely my own (or where submitted to meet the requirements of an approved group assignment is the work of the group), except where work quoted or paraphrased is acknowledged in the text. I also certify that it has not been previously submitted for assessment in this or any other unit or course unless permission for this has been granted by the teaching staff coordinating this unit. I agree that the University may make and retain copies of this work for the purposes of marking and review, and may submit this work to an external plagiarism and collusion detection service who may retain a copy for future plagiarism and collusion detection but will not release it or use it for any other purpose.
7-
plagiarism: Plagiarism and collusion constitute extremely serious academic misconduct. They are forms of cheating, and severe penalties are associated with them, including cancellation of marks for a specific assignment, for a specific unit or even exclusion from the course. If you are ever in doubt about how to cite a reference properly, consult your lecturer or the Study Support website Plagiarism occurs when a student passes off as the student’s own work, or copies without acknowledgement as to its authorship, the work of any other person. Collusion occurs when a student obtains the agreement of another person for a fraudulent purpose, with the intent of obtaining an advantage in submitting an assignment or other work. Work submitted may be reproduced and/or communicated by the university for the purpose of detecting plagiarism and collusion. Students are reminded that assessment work, or parts of assessment work, cannot be re-submitted for a different assessment task in the same unit or any other unit, without the approval from the teaching staff involved. This includes work submitted for assessment at another academic institution. If students wish to reuse or extend parts of previously submitted work then they should discuss this with the teaching staff prior to the submission date. Depending on the nature of the task, the teaching staff may permit or decline the request.
1+
name: Doubtfire University
2+
email_domain: doubtfire.com
3+
host: localhost:3000
4+
product_name: Doubtfire
5+
has_logo: false
6+
logo_url: /assets/images/institution-logo.png
7+
logo_link_url: /
8+
settings: no_institution_setting.rb
9+
privacy: By clicking on the Upload button, I certify that the attached work is entirely my own (or where submitted to meet the requirements of an approved group assignment is the work of the group), except where work quoted or paraphrased is acknowledged in the text. I also certify that it has not been previously submitted for assessment in this or any other unit or course unless permission for this has been granted by the teaching staff coordinating this unit. I agree that the University may make and retain copies of this work for the purposes of marking and review, and may submit this work to an external plagiarism and collusion detection service who may retain a copy for future plagiarism and collusion detection but will not release it or use it for any other purpose.
10+
plagiarism: Plagiarism and collusion constitute extremely serious academic misconduct. They are forms of cheating, and severe penalties are associated with them, including cancellation of marks for a specific assignment, for a specific unit or even exclusion from the course. If you are ever in doubt about how to cite a reference properly, consult your lecturer or the Study Support website Plagiarism occurs when a student passes off as the student’s own work, or copies without acknowledgement as to its authorship, the work of any other person. Collusion occurs when a student obtains the agreement of another person for a fraudulent purpose, with the intent of obtaining an advantage in submitting an assignment or other work. Work submitted may be reproduced and/or communicated by the university for the purpose of detecting plagiarism and collusion. Students are reminded that assessment work, or parts of assessment work, cannot be re-submitted for a different assessment task in the same unit or any other unit, without the approval from the teaching staff involved. This includes work submitted for assessment at another academic institution. If students wish to reuse or extend parts of previously submitted work then they should discuss this with the teaching staff prior to the submission date. Depending on the nature of the task, the teaching staff may permit or decline the request.

0 commit comments

Comments
 (0)