Skip to content

Commit

Permalink
Add LDAP feature CLI support (sonic-net#3022)
Browse files Browse the repository at this point in the history
- What I did
Add LDAP CLI

- How I did it
created the CLI by using YANG model generator, the YANG model can be found in the LDAP HLD:
sonic-net/SONiC#1487

- How to verify it
Manually:
you can use configurations command like"config ldap global " or
"show ldap global" (more examples in the HLD.)
Auto:
1.There are unitest of each policy including good & bad flow in this commit, that should pass.
  • Loading branch information
davidpil2002 authored and arfeigin committed Jun 16, 2024
1 parent d6517f7 commit 453191f
Show file tree
Hide file tree
Showing 8 changed files with 789 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/aaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def trace(option):


@click.command()
@click.argument('auth_protocol', nargs=-1, type=click.Choice(["radius", "tacacs+", "local", "default"]))
@click.argument('auth_protocol', nargs=-1, type=click.Choice(["ldap", "radius", "tacacs+", "local", "default"]))
def login(auth_protocol):
"""Switch login authentication [ {radius, tacacs+, local} | default ]"""
"""Switch login authentication [ {ldap, radius, tacacs+, local} | default ]"""
if len(auth_protocol) is 0:
click.echo('Argument "auth_protocol" is required')
return
Expand All @@ -135,9 +135,9 @@ def login(auth_protocol):
val2 = auth_protocol[1]
good_ap = False
if val == 'local':
if val2 == 'radius' or val2 == 'tacacs+':
if val2 == 'radius' or val2 == 'tacacs+' or val2 == 'ldap':
good_ap = True
elif val == 'radius' or val == 'tacacs+':
elif val == 'radius' or val == 'tacacs+' or val == 'ldap':
if val2 == 'local':
good_ap = True
if good_ap == True:
Expand Down
Loading

0 comments on commit 453191f

Please sign in to comment.