1b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien/*
2b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * Copyright 2008 Google, Inc.
3b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien *
4b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * Licensed under the Apache License, Version 2.0 (the "License");
5b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * you may not use this file except in compliance with the License.
6b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * You may obtain a copy of the License at
7b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien *
8b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien *     http://www.apache.org/licenses/LICENSE-2.0
9b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien *
10b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * Unless required by applicable law or agreed to in writing, software
11b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * distributed under the License is distributed on an "AS IS" BASIS,
12b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * See the License for the specific language governing permissions and
14b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * limitations under the License.
15b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien */
16b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembienpackage net.oauth;
17b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien
18b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembienimport java.io.IOException;
19b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembienimport java.net.URISyntaxException;
20b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien
21b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien/**
22b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * An algorithm to determine whether a message has a valid signature, a correct
23b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * version number, a fresh timestamp, etc.
24b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien *
25b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * @author Dirk Balfanz
26b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * @author John Kristian
27b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien * @hide
28b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien */
29b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembienpublic interface OAuthValidator {
30b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien
31b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien    /**
32b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien     * Check that the given message from the given accessor is valid.
33b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien     * @throws OAuthException TODO
34b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien     * @throws IOException TODO
35b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien     * @throws URISyntaxException
36b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien     * @throws OAuthProblemException the message is invalid.
37b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien     * The implementation should throw exceptions that conform to the OAuth
38b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien     * <a href="http://wiki.oauth.net/ProblemReporting">Problem Reporting extension</a>.
39b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien     */
40b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien    public void validateMessage(OAuthMessage message, OAuthAccessor accessor)
41b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien            throws OAuthException, IOException, URISyntaxException;
42b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien
43b852fcf48a8909164d7f323dd02a35d2a8056a61Nico Sallembien}
44