Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7f80a1b
Merge pull request #462 from uw-it-aca/develop
devights Oct 31, 2024
3385b6a
Merge pull request #463 from uw-it-aca/develop
devights Nov 1, 2024
f2887b6
Merge pull request #464 from uw-it-aca/develop
devights Nov 1, 2024
a0ba6e1
Merge pull request #468 from uw-it-aca/develop
jlaney Jan 17, 2025
361def6
Merge pull request #470 from uw-it-aca/develop
jlaney Feb 4, 2025
2937603
Merge pull request #474 from uw-it-aca/develop
jlaney Feb 6, 2025
ff0b401
Merge pull request #486 from uw-it-aca/develop
devights Apr 15, 2025
03b0818
Merge pull request #509 from uw-it-aca/develop
jlaney Jun 18, 2025
6ec4103
Merge pull request #516 from uw-it-aca/develop
jlaney Jul 14, 2025
1c6bd4a
Merge pull request #519 from uw-it-aca/develop
devights Aug 5, 2025
ac5d615
Merge pull request #522 from uw-it-aca/develop
devights Aug 28, 2025
c4aac56
Merge pull request #531 from uw-it-aca/develop
jlaney Nov 24, 2025
d9c33a2
Merge pull request #533 from uw-it-aca/develop
jlaney Dec 18, 2025
57bda8d
Merge pull request #550 from uw-it-aca/develop
jlaney Mar 13, 2026
5f97dfa
Merge pull request #555 from uw-it-aca/develop
devights Jul 7, 2026
0528879
Merge pull request #560 from uw-it-aca/develop
devights Jul 30, 2026
4959684
uwca cert
devights Aug 25, 2026
0f66a91
force security level 1
devights Aug 26, 2026
86da73a
switching test to prod cert, setting up prod values
devights Aug 26, 2026
36dd758
Merge pull request #572 from uw-it-aca/certs-main
devights Aug 26, 2026
e664be4
add openssl conf
devights Aug 26, 2026
7cd4d68
Merge pull request #573 from uw-it-aca/certs
devights Aug 26, 2026
c1870bf
shorter cache policy for non-200s and sws non-term urls
devights Sep 17, 2026
3566cec
pin npm to fix arborist issue
devights Sep 17, 2026
8810c99
Merge pull request #576 from uw-it-aca/hotfix/cache-policy
devights Sep 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ COPY --from=node-base / /

COPY ./package.json /app/
WORKDIR /app/
RUN npm install --global npm@11.19.1
RUN npm install .

COPY . /app/
Expand Down
7 changes: 6 additions & 1 deletion compass/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@

class CompassRestclientCache(RestclientPymemcacheClient):
def get_cache_expiration_time(self, service, url, status=None):
if status and status != 200:
return ONE_MINUTE * 7

if 'pws' == service:
if re.match(r'^/idcard/v1/photo', url):
return ONE_DAY * 5
return ONE_HOUR * 4
elif 'sws' == service:
return ONE_DAY
if re.match(r'^/student/v5/term/', url):
return ONE_DAY
return ONE_MINUTE * 15
elif 'gws' == service:
return ONE_MINUTE * 15

Expand Down
17 changes: 15 additions & 2 deletions compass/tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,21 @@ def test_cache_expiration_time(self):
pws_time = self.cache.get_cache_expiration_time('pws', '/person/')
self.assertEqual(pws_time, 14400)

sws_time = self.cache.get_cache_expiration_time('sws', '/student/')
self.assertEqual(sws_time, 86400)
sws_term_time = self.cache.get_cache_expiration_time(
'sws', '/student/v5/term/current.json')
self.assertEqual(sws_term_time, 86400)

sws_registration_time = self.cache.get_cache_expiration_time(
'sws', '/student/v5/registration.json')
self.assertEqual(sws_registration_time, 900)

sws_not_found_time = self.cache.get_cache_expiration_time(
'sws', '/student/v5/registration.json', status=404)
self.assertEqual(sws_not_found_time, 420)

sws_unavailable_time = self.cache.get_cache_expiration_time(
'sws', '/student/v5/registration.json', status=503)
self.assertEqual(sws_unavailable_time, 420)

gws_time = self.cache.get_cache_expiration_time('gws', '/group/')
self.assertEqual(gws_time, 900)
Expand Down
35 changes: 24 additions & 11 deletions docker/prod-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ gcsCredentials:

certs:
mounted: true
certPath: /certs/compass.uw.edu-ic.cert
keyPath: /certs/compass.uw.edu-ic.key
secretName: compass.uw.edu-ic-certs
certPath: /certs/compass.uw.edu-uwca.cert
keyPath: /certs/compass.uw.edu-uwca.key
secretName: compass.uw.edu-uwca-certs

mountedSecrets:
enabled: true
mountPath: /ssl
secretName: compass.uw.edu-openssl-conf

cronjob:
enabled: true
Expand All @@ -85,6 +90,9 @@ environmentVariables:
- name: ENV
value: prod

- name: OPENSSL_CONF
value: /ssl/openssl.cnf

- name: SWS_ENV
value: PROD
- name: SWS_TIMEOUT
Expand Down Expand Up @@ -155,18 +163,23 @@ externalSecrets:
data:
- name: credentials.json
property: credentials.json
- name: compass.uw.edu-ic-certs
externalKey: compass/prod/ic-certs
- name: compass.uw.edu-uwca-certs
externalKey: compass/prod/uwca-certs
data:
- name: compass.uw.edu-ic.cert
property: compass.uw.edu-ic.cert
- name: compass.uw.edu-ic.key
property: compass.uw.edu-ic.key
- name: compass.uw.edu-uwca.cert
property: compass.uw.edu-uwca.cert
- name: compass.uw.edu-uwca.key
property: compass.uw.edu-uwca.key
- name: compass.uw.edu-uw-idp-cert
externalKey: idp-cert
data:
- name: uw-idp-cert
property: cert
- name: compass.uw.edu-openssl-conf
externalKey: openssl-conf
data:
- name: openssl.cnf
property: openssl.cnf

environmentVariablesSecrets:
djangoSecret:
Expand All @@ -187,8 +200,8 @@ environmentVariablesSecrets:
secretKey: google-analytics-key
samlSPCert:
name: SP_CERT
secretName: compass.uw.edu-ic-certs
secretKey: compass.uw.edu-ic.cert
secretName: compass.uw.edu-uwca-certs
secretKey: compass.uw.edu-uwca.cert
samlIDPCert:
name: IDP_CERT
secretName: compass.uw.edu-uw-idp-cert
Expand Down
31 changes: 22 additions & 9 deletions docker/test-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,22 @@ gcsCredentials:

certs:
mounted: true
certPath: /certs/compass.uw.edu-ic.cert
keyPath: /certs/compass.uw.edu-ic.key
secretName: test.compass.uw.edu-ic-certs
certPath: /certs/compass.uw.edu-uwca.cert
keyPath: /certs/compass.uw.edu-uwca.key
secretName: test.compass.uw.edu-uwca-certs

mountedSecrets:
enabled: true
mountPath: /ssl
secretName: test.compass.uw.edu-openssl-conf

environmentVariables:
- name: ENV
value: test

- name: OPENSSL_CONF
value: /ssl/openssl.cnf

- name: SWS_ENV
value: PROD
- name: SWS_TIMEOUT
Expand Down Expand Up @@ -142,13 +150,13 @@ externalSecrets:
data:
- name: credentials.json
property: credentials.json
- name: test.compass.uw.edu-ic-certs
externalKey: compass/prod/ic-certs
- name: test.compass.uw.edu-uwca-certs
externalKey: compass/prod/uwca-certs
data:
- name: compass.uw.edu-ic.cert
property: compass.uw.edu-ic.cert
- name: compass.uw.edu-ic.key
property: compass.uw.edu-ic.key
- name: compass.uw.edu-uwca.cert
property: compass.uw.edu-uwca.cert
- name: compass.uw.edu-uwca.key
property: compass.uw.edu-uwca.key
- name: test.compass.uw.edu-sp-cert
externalKey: compass/test/ic-certs
data:
Expand All @@ -159,6 +167,11 @@ externalSecrets:
data:
- name: uw-idp-cert
property: cert
- name: test.compass.uw.edu-openssl-conf
externalKey: openssl-conf
data:
- name: openssl.cnf
property: openssl.cnf

environmentVariablesSecrets:
djangoSecret:
Expand Down