Skip to content

Commit 352f104

Browse files
committed
Organiing packages
1 parent f400379 commit 352f104

24 files changed

+77
-64
lines changed

pom.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<url>https://github.com/IMSGlobal/basiclti-util-java</url>
88
<groupId>org.imsglobal</groupId>
99
<artifactId>basiclti-util</artifactId>
10-
<version>1.0.1-SNAPSHOT</version>
10+
<version>1.1.0-SNAPSHOT</version>
1111
<organization>
1212
<name>IMS Global Learning Consortium</name>
1313
<url>www.imsglobal.org/</url>
@@ -40,6 +40,19 @@
4040
<organizationUrl>http://www.instructure.com/</organizationUrl>
4141
</developer>
4242
</developers>
43+
44+
<reporting>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.apache.maven.plugins</groupId>
48+
<artifactId>maven-javadoc-plugin</artifactId>
49+
<version>2.10.1</version>
50+
<configuration>
51+
</configuration>
52+
</plugin>
53+
</plugins>
54+
</reporting>
55+
4356
<scm>
4457
<connection>scm:git:git@github.com:IMSGlobal/basiclti-util-java.git</connection>
4558
<developerConnection>scm:git:git@github.com:IMSGlobal/basiclti-util-java.git</developerConnection>

src/main/java/org/imsglobal/aspect/LtiLaunchVerifier.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
import org.aspectj.lang.ProceedingJoinPoint;
1010
import org.aspectj.lang.annotation.Around;
1111
import org.aspectj.lang.annotation.Aspect;
12-
import org.imsglobal.basiclti.BasicLTIUtil;
13-
import org.imsglobal.basiclti.LtiVerificationResult;
14-
import org.imsglobal.basiclti.LtiVerifier;
12+
import org.imsglobal.lti.launch.LtiVerificationResult;
13+
import org.imsglobal.lti.launch.LtiVerifier;
1514

1615
import java.util.ArrayList;
1716
import java.util.List;
@@ -32,7 +31,6 @@ public LtiLaunchVerifier(LtiKeySecretService keyService, LtiVerifier ltiVerifier
3231
this.ltiVerifier = ltiVerifier;
3332
}
3433

35-
//@Around("@annotation(launch) && execution(* *(javax.servlet.http.HttpServletRequest+, org.imsglobal.basiclti.LtiVerificationResult, ..)) && args(request, result)")
3634
@Around("@annotation(launch)")
3735
public Object verifyLtiLaunch(ProceedingJoinPoint pjp, Lti launch) throws Throwable {
3836
HttpServletRequest request = null;

src/main/java/org/imsglobal/basiclti/BasicLTIConstants.java renamed to src/main/java/org/imsglobal/lti/BasicLTIConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* implied. See the License for the specific language governing
1414
* permissions and limitations under the License.
1515
*/
16-
package org.imsglobal.basiclti;
16+
package org.imsglobal.lti;
1717

1818
public class BasicLTIConstants {
1919
/**

src/main/java/org/imsglobal/basiclti/BasicLTIUtil.java renamed to src/main/java/org/imsglobal/lti/BasicLTIUtil.java

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
* implied. See the License for the specific language governing
1717
* permissions and limitations under the License.
1818
*/
19-
package org.imsglobal.basiclti;
20-
21-
import static org.imsglobal.basiclti.BasicLTIConstants.CUSTOM_PREFIX;
22-
import static org.imsglobal.basiclti.BasicLTIConstants.EXTENSION_PREFIX;
23-
import static org.imsglobal.basiclti.BasicLTIConstants.LTI_MESSAGE_TYPE;
24-
import static org.imsglobal.basiclti.BasicLTIConstants.LTI_VERSION;
25-
import static org.imsglobal.basiclti.BasicLTIConstants.OAUTH_PREFIX;
26-
import static org.imsglobal.basiclti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_CONTACT_EMAIL;
27-
import static org.imsglobal.basiclti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_DESCRIPTION;
28-
import static org.imsglobal.basiclti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_GUID;
29-
import static org.imsglobal.basiclti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_NAME;
30-
import static org.imsglobal.basiclti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_URL;
19+
package org.imsglobal.lti;
20+
21+
import static org.imsglobal.lti.BasicLTIConstants.CUSTOM_PREFIX;
22+
import static org.imsglobal.lti.BasicLTIConstants.EXTENSION_PREFIX;
23+
import static org.imsglobal.lti.BasicLTIConstants.LTI_MESSAGE_TYPE;
24+
import static org.imsglobal.lti.BasicLTIConstants.LTI_VERSION;
25+
import static org.imsglobal.lti.BasicLTIConstants.OAUTH_PREFIX;
26+
import static org.imsglobal.lti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_CONTACT_EMAIL;
27+
import static org.imsglobal.lti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_DESCRIPTION;
28+
import static org.imsglobal.lti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_GUID;
29+
import static org.imsglobal.lti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_NAME;
30+
import static org.imsglobal.lti.BasicLTIConstants.TOOL_CONSUMER_INSTANCE_URL;
3131

3232
import java.io.IOException;
3333
import java.net.URISyntaxException;
@@ -51,6 +51,9 @@
5151
import net.oauth.server.OAuthServlet;
5252
import net.oauth.signature.OAuthSignatureMethod;
5353
import org.apache.commons.lang3.StringUtils;
54+
import org.imsglobal.lti.launch.LtiError;
55+
import org.imsglobal.lti.launch.LtiLaunch;
56+
import org.imsglobal.lti.launch.LtiVerificationResult;
5457

5558
/* Leave out until we have JTidy 0.8 in the repository
5659
import org.w3c.tidy.Tidy;
@@ -73,8 +76,8 @@
7376
* &lt;extensions&nbsp;platform=&quot;www.lms.com&quot;&gt;
7477
* &lt;parameter&nbsp;key=&quot;keyname&quot;&gt;value&lt;/parameter&gt;
7578
* &lt;/extensions&gt;
76-
* &lt;launch_url&gt;url&nbsp;to&nbsp;the&nbsp;basiclti&nbsp;launch&nbsp;URL&lt;/launch_url&gt;
77-
* &lt;secure_launch_url&gt;url&nbsp;to&nbsp;the&nbsp;basiclti&nbsp;launch&nbsp;URL&lt;/secure_launch_url&gt;
79+
* &lt;launch_url&gt;url&nbsp;to&nbsp;the&nbsp;lti&nbsp;launch&nbsp;URL&lt;/launch_url&gt;
80+
* &lt;secure_launch_url&gt;url&nbsp;to&nbsp;the&nbsp;lti&nbsp;launch&nbsp;URL&lt;/secure_launch_url&gt;
7881
* &lt;icon&gt;url&nbsp;to&nbsp;an&nbsp;icon&nbsp;for&nbsp;this&nbsp;tool&nbsp;(optional)&lt;/icon&gt;
7982
* &lt;secure_icon&gt;url&nbsp;to&nbsp;an&nbsp;icon&nbsp;for&nbsp;this&nbsp;tool&nbsp;(optional)&lt;/secure_icon&gt;
8083
* &lt;cartridge_icon&nbsp;identifierref=&quot;BLTI001_Icon&quot;/&gt;

src/main/java/org/imsglobal/basiclti/XMLMap.java renamed to src/main/java/org/imsglobal/lti/XMLMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************************
2-
* $URL: https://source.sakaiproject.org/svn/basiclti/trunk/basiclti-util/src/java/org/imsglobal/basiclti/XMLMap.java $
2+
* $URL: https://source.sakaiproject.org/svn/lti/trunk/lti-util/src/java/org/imsglobal/lti/XMLMap.java $
33
* $Id: XMLMap.java 308965 2014-04-29 06:37:09Z csev@umich.edu $
44
**********************************************************************************
55
*
@@ -19,7 +19,7 @@
1919
*
2020
**********************************************************************************/
2121

22-
package org.imsglobal.basiclti;
22+
package org.imsglobal.lti;
2323

2424
/*
2525
* This is a little project I call mdom.org which stands for "Map-Dom" or "XML Doms in Maps"

src/main/java/org/imsglobal/basiclti/LtiError.java renamed to src/main/java/org/imsglobal/lti/launch/LtiError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.imsglobal.basiclti;
1+
package org.imsglobal.lti.launch;
22

33
/**
44
* Created by paul on 5/28/14.

src/main/java/org/imsglobal/basiclti/LtiLaunch.java renamed to src/main/java/org/imsglobal/lti/launch/LtiLaunch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.imsglobal.basiclti;
1+
package org.imsglobal.lti.launch;
22

33
import javax.servlet.http.HttpServletRequest;
44
import java.util.Map;

src/main/java/org/imsglobal/basiclti/LtiOauthSigner.java renamed to src/main/java/org/imsglobal/lti/launch/LtiOauthSigner.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.imsglobal.basiclti;
1+
package org.imsglobal.lti.launch;
22

33
import net.oauth.OAuthAccessor;
44
import net.oauth.OAuthConsumer;
@@ -13,11 +13,8 @@
1313
import java.io.IOException;
1414
import java.net.URISyntaxException;
1515
import java.util.HashMap;
16-
import java.util.List;
1716
import java.util.Map;
1817

19-
import static org.imsglobal.basiclti.BasicLTIConstants.*;
20-
2118
/**
2219
* This class <b>signs</b> LTI requests according to the Oauth 1.0 spec
2320
* @author Paul Gray

src/main/java/org/imsglobal/basiclti/LtiOauthVerifier.java renamed to src/main/java/org/imsglobal/lti/launch/LtiOauthVerifier.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
package org.imsglobal.basiclti;
1+
package org.imsglobal.lti.launch;
22

33
import net.oauth.*;
44
import net.oauth.server.OAuthServlet;
5-
import net.oauth.signature.OAuthSignatureMethod;
65

76
import javax.servlet.http.HttpServletRequest;
8-
import java.io.IOException;
9-
import java.net.URISyntaxException;
107
import java.util.Arrays;
118
import java.util.Map;
12-
import java.util.logging.Level;
139
import java.util.logging.Logger;
1410

1511
/**
@@ -53,6 +49,15 @@ public LtiVerificationResult verify(HttpServletRequest request, String secret) t
5349
return new LtiVerificationResult(true, new LtiLaunch(request));
5450
}
5551

52+
/**
53+
* This method will verify a collection of parameters
54+
* @param parameters the parameters that will be verified. mapped by key & value
55+
* @param url the url this request was made at
56+
* @param method the method this url was requested with
57+
* @param secret the secret to verify the propertihes with
58+
* @return
59+
* @throws LtiVerificationException
60+
*/
5661
@Override
5762
public LtiVerificationResult verifyParameters(Map<String, String> parameters, String url, String method, String secret) throws LtiVerificationException {
5863
OAuthMessage oam = new OAuthMessage(method, url, parameters.entrySet());

src/main/java/org/imsglobal/basiclti/LtiSigner.java renamed to src/main/java/org/imsglobal/lti/launch/LtiSigner.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.imsglobal.basiclti;
1+
package org.imsglobal.lti.launch;
22

33
import org.apache.http.HttpRequest;
44

@@ -14,7 +14,7 @@
1414
public interface LtiSigner {
1515

1616
/**
17-
* This method will return a *signed* HttpRequest object.
17+
* This method will return a <b>signed</b> HttpRequest object.
1818
* Once returned, adding new parameters or changing the
1919
* body will invalidate the signature. This method should
2020
* be used for server to server connection requests.
@@ -29,9 +29,9 @@ public interface LtiSigner {
2929
public HttpRequest sign(HttpRequest request, String key, String secret) throws LtiSigningException;
3030

3131
/**
32-
* This method will return a list of *signed*
32+
* This method will return a list of <b>signed</b> parameters.
3333
* Once returned, adding new parameters or changing the
34-
* body will invalidate the signature. This method may
34+
* body will invalidate the signature. This method will
3535
* overwrite reserved parameters from the underlying
3636
* specification. For example, if you are using the Oauth
3737
* implementation, <b>oauth_signature</b> will be removed

0 commit comments

Comments
 (0)