View Javadoc
1   /*
2    * Copyright 2008 Web Cohesion
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.security.oauth.provider.attributes;
18  
19  import org.springframework.security.access.SecurityConfig;
20  
21  /**
22   * Security config for consumer authorization of a method.
23   * 
24   * @author Ryan Heaton
25   */
26  @SuppressWarnings("serial")
27  public class ConsumerSecurityConfig extends SecurityConfig {
28  
29    public static final ConsumerSecurityConfigutes/ConsumerSecurityConfig.html#ConsumerSecurityConfig">ConsumerSecurityConfig DENY_ALL_ATTRIBUTE = new ConsumerSecurityConfig(DenyAllConsumers.class.getName(), null);
30    public static final ConsumerSecurityConfiges/ConsumerSecurityConfig.html#ConsumerSecurityConfig">ConsumerSecurityConfig PERMIT_ALL_ATTRIBUTE = new ConsumerSecurityConfig(PermitAllConsumers.class.getName(), null);
31  
32    /**
33     * Type of security.
34     */
35    public enum ConsumerSecurityType {
36  
37      /**
38       * Consumer key type.
39       */
40      CONSUMER_KEY,
41  
42      /**
43       * Consumer role type.
44       */
45      CONSUMER_ROLE
46  
47    }
48  
49    private final ConsumerSecurityType securityType;
50  
51    public ConsumerSecurityConfig(String config, ConsumerSecurityType type) {
52      super(config);
53      this.securityType = type;
54    }
55  
56    public ConsumerSecurityType getSecurityType() {
57      return securityType;
58    }
59  }