Skip to content

Commit

Permalink
Remove DN and CA from User model
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Oct 2, 2023
1 parent ae3faf7 commit 1120bae
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
4 changes: 1 addition & 3 deletions src/diracx/cli/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ def add_user(
vo: str = "testvo",
user_group: str = "user",
sub: str = "usersub",
dn: str = "DN",
ca: str = "CA",
preferred_username: str = "preferred_username",
):
"""Add a user to an existing vo and group"""
Expand All @@ -87,7 +85,7 @@ def add_user(

repo_path = Path(config_repo.path)

new_user = UserConfig(CA=ca, DN=dn, PreferedUsername=preferred_username)
new_user = UserConfig(PreferedUsername=preferred_username)

config = ConfigSource.create_from_url(backend_url=repo_path).read_config()

Expand Down
2 changes: 0 additions & 2 deletions src/diracx/core/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ def legacy_adaptor(cls, v):


class UserConfig(BaseModel):
CA: str
DN: str
PreferedUsername: str
Email: EmailStr | None
Suspended: list[str] = []
Expand Down
7 changes: 0 additions & 7 deletions tests/cli/test_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ def test_add_user(tmp_path, vo, user_group):
cs_repo = f"git+file://{tmp_path}"

sub = "lhcb:chaen"
dn = "/something/somethin/DN"
ca = "CERN"
preferred_username = "dontCallMeShirley"

# Create the CS
Expand All @@ -57,10 +55,6 @@ def test_add_user(tmp_path, vo, user_group):
user_group,
"--sub",
sub,
"--dn",
dn,
"--ca",
ca,
"--preferred-username",
preferred_username,
],
Expand All @@ -76,4 +70,3 @@ def test_add_user(tmp_path, vo, user_group):
# check the user is defined
assert vo in config.Registry
assert sub in config.Registry[vo].Users
assert ca == config.Registry[vo].Users[sub].CA

0 comments on commit 1120bae

Please sign in to comment.