Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions src/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
dockerfile: server-rm/Dockerfile
ports:
- "127.0.0.1:8800:8080"
# volumes:
# - ./oslcOAuthStore.xml:/var/lib/jetty/oslcOAuthStore.xml:ro
# Uncomment to configure the base URL for reverse proxy or custom domain deployments
# environment:
# - LYO_BASEURL=https://mytoolchain.example.com:9443/refimpl/rm
Expand Down
46 changes: 46 additions & 0 deletions src/oslcOAuthStore.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oauth="http://eclipse.org/lyo/server/oauth#">

<!-- Sample OAuth 1.0a Consumer for a web application -->
<rdf:Description>
<rdf:type rdf:resource="http://eclipse.org/lyo/server/oauth#Consumer"/>
<oauth:consumerKey>web-app-consumer</oauth:consumerKey>
<oauth:consumerSecret>d2ViLWFwcC1zZWNyZXQtYTFiMmMzZDRlNWY2ZzdoOGk5ajA=</oauth:consumerSecret>
<oauth:consumerName>Web Application Client</oauth:consumerName>
<oauth:trusted>false</oauth:trusted>
<oauth:provisional>false</oauth:provisional>
</rdf:Description>

<!-- Sample OAuth 1.0a Consumer for a mobile application -->
<rdf:Description>
<rdf:type rdf:resource="http://eclipse.org/lyo/server/oauth#Consumer"/>
<oauth:consumerKey>mobile-app-consumer</oauth:consumerKey>
<oauth:consumerSecret>bW9iaWxlLWFwcC1zZWNyZXQtazlsOG03bjZvNXA0cTNyMnMxdDA=</oauth:consumerSecret>
<oauth:consumerName>Mobile Application Client</oauth:consumerName>
<oauth:trusted>false</oauth:trusted>
<oauth:provisional>false</oauth:provisional>
</rdf:Description>

<!-- Sample trusted OAuth 1.0a Consumer for automated systems -->
<rdf:Description>
<rdf:type rdf:resource="http://eclipse.org/lyo/server/oauth#Consumer"/>
<oauth:consumerKey>automation-consumer</oauth:consumerKey>
<oauth:consumerSecret>YXV0b21hdGlvbi1zZWNyZXQtdTF2Mncza3g0eTV6NmE3YjhjOWQw</oauth:consumerSecret>
<oauth:consumerName>Automation Service</oauth:consumerName>
<oauth:trusted>true</oauth:trusted>
<oauth:provisional>false</oauth:provisional>
</rdf:Description>

<!-- Sample provisional consumer for development/testing -->
<rdf:Description>
<rdf:type rdf:resource="http://eclipse.org/lyo/server/oauth#Consumer"/>
<oauth:consumerKey>dev-test-consumer</oauth:consumerKey>
<oauth:consumerSecret>ZGV2LXRlc3Qtc2VjcmV0LWUxZjJnM2g0aTVqNms3bDhtOW4w</oauth:consumerSecret>
<oauth:consumerName>Development Test Client</oauth:consumerName>
<oauth:trusted>false</oauth:trusted>
<oauth:provisional>true</oauth:provisional>
</rdf:Description>

</rdf:RDF>
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,28 @@ public static AuthenticationApplication getApplication() {
// End of user code
return authenticationApplication;
}


/**
* Returns filename for the auth configuration; warns and returns null if missing
*/
public String getOslcConsumerStoreFilename() {
if (oslcConsumerStoreFilename == null) {
log.warn("OSLC Consumer Store filename is null");
return null;
}

java.nio.file.Path absolutePath =
java.nio.file.Paths.get(oslcConsumerStoreFilename).toAbsolutePath();
log.debug("OSLC Consumer Store filename - relative: {}, absolute: {}",
oslcConsumerStoreFilename, absolutePath);

if (!java.nio.file.Files.exists(absolutePath)) {
log.warn("OSLC Consumer Store file does not exist: {}", absolutePath);
}

return oslcConsumerStoreFilename;
}

@Override
public String getName() {
// Display name for this application.
Expand Down