Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5c8b7c1

Browse files
nejchJohnVillalovos
authored andcommitted
refactor(groups): remove deprecated LDAP group link add/delete methods
BREAKING CHANGE: The deprecated `group.add_ldap_group_link()` and `group.delete_ldap_group_link()`methods are no longer available. Use `group.ldap_group_links.create()` and `group.ldap_group_links.delete()`instead.
1 parent27ed490 commit5c8b7c1

File tree

1 file changed

+1
-59
lines changed

1 file changed

+1
-59
lines changed

‎gitlab/v4/objects/groups.py‎

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
importgitlab
66
fromgitlabimportcli
77
fromgitlabimportexceptionsasexc
8-
fromgitlabimporttypes,utils
8+
fromgitlabimporttypes
99
fromgitlab.baseimportRESTManager,RESTObject
1010
fromgitlab.mixinsimport (
1111
CreateMixin,
@@ -164,64 +164,6 @@ def search(
164164
path=f"/groups/{self.encoded_id}/search"
165165
returnself.manager.gitlab.http_list(path,query_data=data,**kwargs)
166166

167-
@cli.register_custom_action("Group", ("cn","group_access","provider"))
168-
@exc.on_http_error(exc.GitlabCreateError)
169-
defadd_ldap_group_link(
170-
self,cn:str,group_access:int,provider:str,**kwargs:Any
171-
)->None:
172-
"""Add an LDAP group link.
173-
174-
Args:
175-
cn: CN of the LDAP group
176-
group_access: Minimum access level for members of the LDAP
177-
group
178-
provider: LDAP provider for the LDAP group
179-
**kwargs: Extra options to send to the server (e.g. sudo)
180-
181-
Raises:
182-
GitlabAuthenticationError: If authentication is not correct
183-
GitlabCreateError: If the server cannot perform the request
184-
"""
185-
utils.warn(
186-
message=(
187-
"The add_ldap_group_link() method is deprecated and will be removed "
188-
"in a future version. Use ldap_group_links.create() instead."
189-
),
190-
category=DeprecationWarning,
191-
)
192-
path=f"/groups/{self.encoded_id}/ldap_group_links"
193-
data= {"cn":cn,"group_access":group_access,"provider":provider}
194-
self.manager.gitlab.http_post(path,post_data=data,**kwargs)
195-
196-
@cli.register_custom_action("Group", ("cn",), ("provider",))
197-
@exc.on_http_error(exc.GitlabDeleteError)
198-
defdelete_ldap_group_link(
199-
self,cn:str,provider:Optional[str]=None,**kwargs:Any
200-
)->None:
201-
"""Delete an LDAP group link.
202-
203-
Args:
204-
cn: CN of the LDAP group
205-
provider: LDAP provider for the LDAP group
206-
**kwargs: Extra options to send to the server (e.g. sudo)
207-
208-
Raises:
209-
GitlabAuthenticationError: If authentication is not correct
210-
GitlabDeleteError: If the server cannot perform the request
211-
"""
212-
utils.warn(
213-
message=(
214-
"The delete_ldap_group_link() method is deprecated and will be "
215-
"removed in a future version. Use ldap_group_links.delete() instead."
216-
),
217-
category=DeprecationWarning,
218-
)
219-
path=f"/groups/{self.encoded_id}/ldap_group_links"
220-
ifproviderisnotNone:
221-
path+=f"/{provider}"
222-
path+=f"/{cn}"
223-
self.manager.gitlab.http_delete(path,**kwargs)
224-
225167
@cli.register_custom_action("Group")
226168
@exc.on_http_error(exc.GitlabCreateError)
227169
defldap_sync(self,**kwargs:Any)->None:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp