Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Users Account and Users Groups #11

Merged
merged 6 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions extensions/users/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 🧩 Accounts management schema extension

This schema extension contains models for Accounts management.

## Nodes

- UserAccount
- UserGroup

## Generics

## Dependencies

- Base
108 changes: 108 additions & 0 deletions extensions/users/users.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: '1.0'

nodes:
- name: Group
namespace: User
description: "User Group"
label: "User Groups"
icon: "iconoir:group"
display_labels:
- name__value
order_by:
- name__value
uniqueness_constraints:
- ["name__value"]
human_friendly_id:
- "name__value"
attributes:
- name: name
kind: Text
order_weight: 1000
- name: description
kind: Text
optional: true
order_weight: 1100
- name: idle_timeout
label: Idle Timeout (s)
kind: Number
order_weight: 1300
- name: permissions
kind: Dropdown
optional: false
choices:
- name: admin
description: "All rights on device."
color: "#E6E6FA" # lavender
- name: operator
description: "Operator right on configuration."
color: "#E6E6FA" # lavender
- name: read-only
description: "Read only right on configuration."
color: "#E6E6FA" # lavender
order_weight: 1200

- name: Account
namespace: User
description: "User login and authentication"
label: "User Account"
icon: "mdi:account-key"
display_labels:
- name__value
order_by:
- name__value
uniqueness_constraints:
- ["name__value"]
human_friendly_id:
- "name__value"
attributes:
- name: name
label: Username
kind: Text
optional: false
description: "The login username"
order_weight: 1000
- name: full_name
kind: Text
optional: true
description: "Full name of the account"
order_weight: 1100
- name: ssh_key
kind: Password
optional: true
description: "SSH key for secure access"
order_weight: 1300
- name: password
kind: Password
optional: true
description: "Password for login (alternative to SSH key)"
order_weight: 1400
- name: mfa_enabled
kind: Boolean
default_value: false
description: "Whether multi-factor authentication is enabled"
order_weight: 1500
relationships:
- name: user_group
peer: UserGroup
cardinality: one
optional: false
kind: Attribute
order_weight: 1200
- name: organization
peer: OrganizationGeneric
optional: false
cardinality: one
kind: Parent

extensions:
nodes:
# Organization Extensions
- kind: OrganizationGeneric
relationships:
- name: accounts
kind: Component
peer: UserAccount
description: "List of Accounts under this organization"
cardinality: many