Skip to content
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

feat: Improve API key management #57

Merged
merged 5 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
22 changes: 22 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'

# Add test API key to the OBA service
- name: Patch XML
uses: jannekem/run-python-script-action@v1
with:
script: |
import xml.etree.ElementTree as ET
f = './oba/config/onebusaway-api-webapp-data-sources.xml'
ET.register_namespace('', "http://www.springframework.org/schema/beans")
tree = ET.parse(f)
root = tree.getroot()
new_node = ET.Element('bean')
new_node.set('class', 'org.onebusaway.users.impl.CreateApiKeyAction')
property_node = ET.SubElement(new_node, 'property')
property_node.set('name', 'key')
property_node.set('value', 'TEST')
root.append(new_node)
tree.write(f)

- name: Docker Compose up
run: docker-compose up -d

Expand Down
5 changes: 0 additions & 5 deletions oba/config/onebusaway-api-webapp-data-sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@
<constructor-arg type="java.lang.String" value="" />
</bean>

<!-- Allows the TEST key for OBA API testing. Should be removed in production -->
<bean class="org.onebusaway.users.impl.CreateApiKeyAction">
<property name="key" value="TEST"/>
</bean>

<!-- iOS Client key -->
<bean class="org.onebusaway.users.impl.CreateApiKeyAction">
<property name="key" value="org.onebusaway.iphone"/>
Expand Down
Loading