// Path: frostillicus-blog/frostillicus-blog-j2ee/src/main/java/security/DarwinoPrincipal.java
// public class DarwinoPrincipal implements Principal {
// 	private final User user;
// 
// 	public DarwinoPrincipal(final User user) {
// 		this.user = user;
// 	}
// 
// 	@Override
// 	public String getName() {
// 		return user.getDn();
// 	}
// 
// }


import java.security.Principal;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.core.UriInfo;
import com.darwino.platform.DarwinoContext;
import security.DarwinoPrincipal;
/*
 * Copyright © 2012-2020 Jesse Gallagher
 *
 * 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.
 */
package security.jaxrs;





/**
 *
 * @author Jesse Gallagher
 * @since 2.5.0
 */
public class DarwinoJAXRSSecurityContext implements SecurityContext {
	private final UriInfo uriInfo;

	public DarwinoJAXRSSecurityContext(final UriInfo uriInfo) {
		this.uriInfo = uriInfo;
	}

	@Override
	public Principal getUserPrincipal() {
// Path: frostillicus-blog/frostillicus-blog-j2ee/src/main/java/security/DarwinoPrincipal.java
// public class DarwinoPrincipal implements Principal {
// 	private final User user;
// 
// 	public DarwinoPrincipal(final User user) {
// 		this.user = user;
// 	}
// 
// 	@Override
// 	public String getName() {
// 		return user.getDn();
// 	}
// 
// }


// Path: frostillicus-blog/frostillicus-blog-j2ee/src/main/java/security/jaxrs/DarwinoJAXRSSecurityContext.java
import java.security.Principal;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.core.UriInfo;
import com.darwino.platform.DarwinoContext;
import security.DarwinoPrincipal;

/*
 * Copyright © 2012-2020 Jesse Gallagher
 *
 * 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.
 */
package security.jaxrs;





/**
 *
 * @author Jesse Gallagher
 * @since 2.5.0
 */
public class DarwinoJAXRSSecurityContext implements SecurityContext {
	private final UriInfo uriInfo;

	public DarwinoJAXRSSecurityContext(final UriInfo uriInfo) {
		this.uriInfo = uriInfo;
	}

	@Override
	public Principal getUserPrincipal() {
		return new DarwinoPrincipal(DarwinoContext.get().getUser());