2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
22 package org.onap.aaf.auth.env;
24 import java.util.Date;
26 import javax.servlet.http.HttpServletRequest;
27 import javax.servlet.http.HttpServletResponse;
29 import org.onap.aaf.auth.org.Organization;
30 import org.onap.aaf.cadi.Lur;
31 import org.onap.aaf.cadi.Permission;
32 import org.onap.aaf.cadi.principal.TaggedPrincipal;
33 import org.onap.aaf.misc.env.LogTarget;
34 import org.onap.aaf.misc.env.TransStore;
36 public interface AuthzTrans extends TransStore {
37 public enum REQD_TYPE {future(1),force(2),move(4),ns(8),detail(16);
45 public abstract AuthzTrans set(HttpServletRequest req, HttpServletResponse resp);
47 public abstract HttpServletRequest hreq();
49 public abstract HttpServletResponse hresp();
51 public abstract String user();
53 public abstract void setUser(TaggedPrincipal p);
55 public abstract TaggedPrincipal getUserPrincipal();
57 public abstract String ip();
59 public abstract int port();
61 public abstract String meth();
63 public abstract String path();
65 public abstract String agent();
67 public abstract AuthzEnv env();
69 public abstract void setLur(Lur lur);
71 public abstract Lur getLur();
73 public abstract boolean fish(Permission ... p);
75 public abstract Organization org();
77 public abstract boolean requested(REQD_TYPE requested);
79 public void requested(REQD_TYPE requested, boolean b);
81 public abstract void logAuditTrail(LogTarget lt);
83 public abstract Date now();
85 public abstract void setTag(String tag);
87 public abstract String getTag();
89 public abstract void clearCache();