summaryrefslogtreecommitdiffstats
path: root/kubernetes/sdnc/.helmignore
blob: f0c13194444163d1cba5c67d9e79231a62bc8f44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
#0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/**
 * ============LICENSE_START====================================================
 * org.onap.aaf
 * ===========================================================================
 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
 * ===========================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END====================================================
 *
 */
package org.onap.aaf.cadi.shiro;

import java.security.Principal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.apache.log4j.Logger;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.Permission;
import org.onap.aaf.cadi.Access;

/**
 * We treat "roles" and "permissions" in a similar way for first pass.
 * 
 * @author JonathanGathman
 *
 */
public class AAFAuthorizationInfo implements AuthorizationInfo {
	
	final static Logger logger = Logger.getLogger(AuthorizationInfo.class);
	
	private static final long serialVersionUID = -4805388954462426018L;
	private Access access;
	private Principal bait;
	private List<org.onap.aaf.cadi.Permission> pond;
	private ArrayList<String> sPerms;
	private ArrayList<Permission> oPerms;

	public AAFAuthorizationInfo(Access access, Principal bait, List<org.onap.aaf.cadi.Permission> pond) {
		this.access = access;
		this.bait = bait;
		this.pond = pond;
		sPerms=null;
		oPerms=null;
	}
	
	public Principal principal() {
		return bait;
	}
	
	@Override
	public Collection<Permission> getObjectPermissions() {
		logger.debug("AAFAuthorizationInfo.getObjectPermissions");
		synchronized(bait) {
			if(oPerms == null) {
				oPerms = new ArrayList<Permission>(); 
				for(final org.onap.aaf.cadi.Permission p : pond) {
					oPerms.add(new AAFShiroPermission(p));
				}
			}
		}
		return oPerms;
	}

	@Override
	public Collection<String> getRoles() {
		logger.debug("AAFAuthorizationInfo.getRoles");
		// Until we decide to make Roles available, tie into String based permissions.
		return getStringPermissions();
	}

	@Override
	public Collection<String> getStringPermissions() {
		logger.debug("AAFAuthorizationInfo.getStringPermissions");
		synchronized(bait) {
			if(sPerms == null) {
				sPerms = new ArrayList<String>(); 
				for(org.onap.aaf.cadi.Permission p : pond) {
					sPerms.add(p.getKey().replace("|",":"));
				}
			}
		}
		return sPerms;
	}

}