/* -*- Mode: JDE; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * This file is part of the debugger and core tools for the AspectJ(tm) * programming language; see http://aspectj.org * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is AspectJ. * * The Initial Developer of the Original Code is Xerox Corporation. Portions * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation. * All Rights Reserved. */ package org.aspectj.ajdoc; import com.sun.javadoc.Type; /** * Documentation for a piece of advice. * * @author Jeff Palm */ public interface AdviceDoc extends ExecutableMemberDoc, com.sun.javadoc.ExecutableMemberDoc { /** * Returns true if the advice is abstract. * * @return true if the advice is abstract. */ public boolean isAbstract(); /** * Returns a {@link #AspectDoc} representing the aspect * that is overriden by this advice. * * @return a AspectDoc representing the aspect * that is overriden by this advice. */ public AspectDoc overriddenAspect(); /** * Returns the return type of this advice -- it may be null. * * @return the return type of this advice -- it may be null. */ public Type returnType(); /** * Returns the array of docs this advice crosscuts. * * @return an array of docs this advice crosscuts. */ public com.sun.javadoc.ExecutableMemberDoc[] crosscuts(); /** * Returns true if this is throwing advice. * * @return true if this is throwing advice. */ public boolean isThrowing(); /** * Returns true if this is returning advice. * * @return true if this is returning advice. */ public boolean isReturning(); /** * Returns the extra formal type that's the optional type * to after returning or after throwing * advice. * * @return an instance of Type that represents the the extra formal type * that's the optional type to after returning or * after throwing advice. */ public Type extraType(); } ption value='add-integration-tests-for-deleting-a-file-copied-from-a-share'>add-integration-tests-for-deleting-a-file-copied-from-a-share Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/build/integration/ldap_features/ldap-openldap.feature
blob: 14fa3b6396824ac4e97b4c18f9c47ca86fa5f9c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
Feature: LDAP
  Background:
    Given using api version "2"
    And having a valid LDAP configuration

  Scenario: Test valid configuration by logging in
    Given Logging in using web as "alice"
    And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
    Then the HTTP status code should be "200"

  Scenario: Test valid configuration with port in the hostname by logging in
    Given modify LDAP configuration
      | ldapHost | openldap:389 |
    And cookies are reset
    And Logging in using web as "alice"
    And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
    Then the HTTP status code should be "200"

  Scenario: Test valid configuration with LDAP protocol by logging in
    Given modify LDAP configuration
      | ldapHost | ldap://openldap |
    And cookies are reset
    And Logging in using web as "alice"
    And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
    Then the HTTP status code should be "200"

  Scenario: Test valid configuration with LDAP protocol and port by logging in
    Given modify LDAP configuration
      | ldapHost | ldap://openldap:389 |
    And cookies are reset
    And Logging in using web as "alice"
    And Sending a "GET" to "/remote.php/webdav/welcome.txt" with requesttoken
    Then the HTTP status code should be "200"

  Scenario: Look for a known LDAP user
    Given As an "admin"
    And sending "GET" to "/cloud/users?search=alice"
    Then the OCS status code should be "200"
    And looking up details for the first result matches expectations
      | email           | alice@nextcloud.ci |
      | displayname     | Alice              |

  Scenario: Test group filter with one specific group
    Given modify LDAP configuration
      | ldapGroupFilter          | cn=RedGroup |
      | ldapGroupMemberAssocAttr | member |
      | ldapBaseGroups           | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci  |
    And As an "admin"
    And sending "GET" to "/cloud/groups"
    Then the OCS status code should be "200"
    And the "groups" result should match
      | RedGroup     | 1 |
      | GreenGroup   | 0 |
      | BlueGroup    | 0 |
      | PurpleGroup  | 0 |

  Scenario: Test group filter with two specific groups
    Given modify LDAP configuration
      | ldapGroupFilter          | (\|(cn=RedGroup)(cn=GreenGroup)) |
      | ldapGroupMemberAssocAttr | member |
      | ldapBaseGroups           | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
    And As an "admin"
    And sending "GET" to "/cloud/groups"
    Then the OCS status code should be "200"
    And the "groups" result should match
      | RedGroup     | 1 |
      | GreenGroup   | 1 |
      | BlueGroup    | 0 |
      | PurpleGroup  | 0 |

  Scenario: Test group filter ruling out a group from a different base
    Given modify LDAP configuration
      | ldapGroupFilter          | (objectClass=groupOfNames) |
      | ldapGroupMemberAssocAttr | member |
      | ldapBaseGroups           | ou=Groups,ou=Ordinary,dc=nextcloud,dc=ci |
    And As an "admin"
    And sending "GET" to "/cloud/groups"
    Then the OCS status code should be "200"
    And the "groups" result should match
      | RedGroup     | 1 |
      | GreenGroup   | 1 |
      | BlueGroup    | 1 |
      | PurpleGroup  | 1 |
      | SquareGroup  | 0 |

  Scenario: Test backup server
    Given modify LDAP configuration
      | ldapBackupHost | openldap |
      | ldapBackupPort | 389      |
      | ldapHost       | foo.bar  |
      | ldapPort       | 2456     |
    And Logging in using web as "alice"
    Then the HTTP status code should be "200"

  Scenario: Test backup server offline
    Given modify LDAP configuration
      | ldapBackupHost | off.line |
      | ldapBackupPort | 3892     |
      | ldapHost       | foo.bar  |
      | ldapPort       | 2456     |
    Then Expect ServerException on failed web login as "alice"

  Scenario: Test LDAP server offline, no backup server
    Given modify LDAP configuration
      | ldapHost       | foo.bar  |
      | ldapPort       | 2456     |
    Then Expect ServerException on failed web login as "alice"

  Scenario: Test LDAP group membership with intermediate groups not matching filter
    Given modify LDAP configuration
      | ldapBaseGroups                | ou=OtherGroups,dc=nextcloud,dc=ci |
      | ldapGroupFilter               | (&(cn=Gardeners)(objectclass=groupOfNames)) |
      | ldapNestedGroups              | 1 |
      | useMemberOfToDetectMembership | 1 |
      | ldapUserFilter                | (&(objectclass=inetorgperson)(!(uid=alice))) |
      | ldapExpertUsernameAttr        | uid |
      | ldapGroupMemberAssocAttr      | member |
    And As an "admin"
    # for population
    And sending "GET" to "/cloud/groups"
    And sending "GET" to "/cloud/groups/Gardeners/users"
    Then the OCS status code should be "200"
    And the "users" result should match
      | alice  | 0 |
      | clara  | 1 |
      | elisa  | 1 |
      | gustaf | 1 |
      | jesper | 1 |

  Scenario: Test LDAP group membership with intermediate groups not matching filter and without memberof
    Given modify LDAP configuration
      | ldapBaseGroups                | ou=OtherGroups,dc=nextcloud,dc=ci |
      | ldapGroupFilter               | (&(cn=Gardeners)(objectclass=groupOfNames)) |
      | ldapNestedGroups              | 1 |
      | useMemberOfToDetectMembership | 0 |
      | ldapUserFilter                | (&(objectclass=inetorgperson)(!(uid=alice))) |
      | ldapExpertUsernameAttr        | uid |
      | ldapGroupMemberAssocAttr      | member |
    And As an "admin"
    # for population
    And sending "GET" to "/cloud/groups"
    And sending "GET" to "/cloud/groups/Gardeners/users"
    Then the OCS status code should be "200"
    And the "users" result should match
      | alice  | 0 |
      | clara  | 1 |
      | elisa  | 1 |
      | gustaf | 1 |
      | jesper | 1 |

  Scenario: Test LDAP group membership with intermediate groups not matching filter, numeric group ids
    Given modify LDAP configuration
      | ldapBaseGroups                | ou=NumericGroups,dc=nextcloud,dc=ci |
      | ldapGroupFilter               | (&(cn=2000)(objectclass=groupOfNames)) |
      | ldapNestedGroups              | 1 |
      | useMemberOfToDetectMembership | 1 |
      | ldapUserFilter                | (&(objectclass=inetorgperson)(!(uid=alice))) |
      | ldapExpertUsernameAttr        | uid |
      | ldapGroupMemberAssocAttr      | member |
    And As an "admin"
    # for population
    And sending "GET" to "/cloud/groups"
    And sending "GET" to "/cloud/groups/2000/users"
    Then the OCS status code should be "200"
    And the "users" result should match
      | alice  | 0 |
      | clara  | 1 |
      | elisa  | 1 |
      | gustaf | 1 |
      | jesper | 1 |