remove old readme
[atutor.git] / mods / _standard / social / lib / SecurityToken.php
1 <?php
2 /**
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  */
20
21 /**
22  * An abstract representation of a signing token.
23  * Use in conjunction with @code SecurityTokenDecoder.
24  */
25 abstract class SecurityToken {
26
27   //FIXME Hmm seems php is refusing to let me make abstract static functions? odd
28   static public function createFromToken($token, $maxage) {}
29
30   static public function createFromValues($owner, $viewer, $app, $domain, $appUrl, $moduleId) {}
31
32   /**
33    * Serializes the token into a string. This can be the exact same as
34    * toString; using a different name here is only to force interface
35    * compliance.
36    *
37    * @return A string representation of the token.
38    */
39   abstract public function toSerialForm();
40
41   /**
42    * @return the owner from the token, or null if there is none.
43    */
44   abstract public function getOwnerId();
45
46   /**
47    * @return the viewer from the token, or null if there is none.
48    */
49   abstract public function getViewerId();
50
51   /**
52    * @return the application id from the token, or null if there is none.
53    */
54   abstract public function getAppId();
55
56   /**
57    * @return the domain from the token, or null if there is none.
58    */
59   abstract public function getDomain();
60
61   /**
62    * @return the URL of the application
63    */
64   abstract public function getAppUrl();
65
66   /**
67    * @return the module ID of the application
68    */
69   abstract public function getModuleId();
70 }