You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by ra...@apache.org on 2019/01/17 13:10:29 UTC
[tomee] 15/17: TOMEE-2365 - Added missing API for IdentityStore.
This is an automated email from the ASF dual-hosted git repository.
radcortez pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git
commit c5d35aa7cc2a693c2289dd65699fa631f7d997a6
Author: Roberto Cortez <ra...@yahoo.com>
AuthorDate: Thu Jan 17 12:30:24 2019 +0000
TOMEE-2365 - Added missing API for IdentityStore.
---
.../identitystore/IdentityStorePermission.java | 31 +++++++++++++
.../identitystore/IdentityStoreWrapper.java | 52 ++++++++++++++++++++++
2 files changed, 83 insertions(+)
diff --git a/tomee/tomee-security/src/main/java/javax/security/enterprise/identitystore/IdentityStorePermission.java b/tomee/tomee-security/src/main/java/javax/security/enterprise/identitystore/IdentityStorePermission.java
new file mode 100644
index 0000000..a44fe50
--- /dev/null
+++ b/tomee/tomee-security/src/main/java/javax/security/enterprise/identitystore/IdentityStorePermission.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 javax.security.enterprise.identitystore;
+
+import java.security.BasicPermission;
+
+public class IdentityStorePermission extends BasicPermission {
+ private static final long serialVersionUID = 1254057022829640365L;
+
+ public IdentityStorePermission(String name) {
+ super(name);
+ }
+
+ public IdentityStorePermission(String name, String action) {
+ super(name, action);
+ }
+}
diff --git a/tomee/tomee-security/src/main/java/javax/security/enterprise/identitystore/IdentityStoreWrapper.java b/tomee/tomee-security/src/main/java/javax/security/enterprise/identitystore/IdentityStoreWrapper.java
new file mode 100644
index 0000000..113909a
--- /dev/null
+++ b/tomee/tomee-security/src/main/java/javax/security/enterprise/identitystore/IdentityStoreWrapper.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 javax.security.enterprise.identitystore;
+
+import javax.security.enterprise.credential.Credential;
+import java.util.Set;
+
+public class IdentityStoreWrapper implements IdentityStore {
+ private final IdentityStore identityStore;
+
+ public IdentityStoreWrapper(IdentityStore identityStore) {
+ this.identityStore = identityStore;
+ }
+
+ public IdentityStore getWrapped() {
+ return identityStore;
+ }
+
+ @Override
+ public CredentialValidationResult validate(Credential credential) {
+ return getWrapped().validate(credential);
+ }
+
+ @Override
+ public Set<String> getCallerGroups(CredentialValidationResult validationResult) {
+ return getWrapped().getCallerGroups(validationResult);
+ }
+
+ @Override
+ public int priority() {
+ return getWrapped().priority();
+ }
+
+ @Override
+ public Set<ValidationType> validationTypes() {
+ return getWrapped().validationTypes();
+ }
+}