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

YAML schema does not match ak export_blueprint #7789

Closed
septatrix opened this issue Dec 5, 2023 · 7 comments · Fixed by #9140
Closed

YAML schema does not match ak export_blueprint #7789

septatrix opened this issue Dec 5, 2023 · 7 comments · Fixed by #9140
Labels
bug Something isn't working

Comments

@septatrix
Copy link
Contributor

Describe the bug
ak export_blueprint provides blueprints with UUIDs in several places where the schema however expects integers.

To Reproduce

  1. Open a shell in the worker container
  2. Run ak export_blueprint
  3. Copy the generated blueprint (or a part of it) into VSCode and add the schema hint to the top (# yaml-language-server: $schema=https://version-2023-10.goauthentik.io/blueprints/schema.json)
  4. Several fields with a UUID as a value are underlined with the error: Incorrect type. Expected "integer". yaml-schema: Property mappings

Expected behavior
The output generated by ak export_blueprint should match the structure expected by the schema (or vice versa).

Version and Deployment (please complete the following information):

  • authentik version: 2023.10.4
  • Deployment: docker-compose

Additional context
Also some of the entries generated have a null id. Not sure if that is intended.

@septatrix septatrix added the bug Something isn't working label Dec 5, 2023
@BeryJu
Copy link
Member

BeryJu commented Dec 5, 2023

The warnings happen due to the fact that YAML scheams don't know the value of any YAML tags, so this is sadly currently to be expected. I'm not aware of any YAML schema implementation that would correctly support this

@septatrix
Copy link
Contributor Author

Would it work to define the fields as type: string, format: uuid?

@BeryJu
Copy link
Member

BeryJu commented Dec 5, 2023

can you post a snippet of a segment that has this error? The field annotations should be correct as they're generated the same way the API schema is generated, which is directly from the database model (in most cases anyways)

@septatrix
Copy link
Contributor Author

# yaml-language-server: $schema=https://version-2023-10.goauthentik.io/blueprints/schema.json
version: 1
entries:
- attrs:
    base_dn: dc=cde-ev,dc=de
    bind_cn: cn=admin,ou=duas,dc=cde-ev,dc=de
    enabled: true
    group_membership_field: uniqueMember
    group_object_filter: (objectClass=groupOfUniqueNames)
    name: CdEDB LDAP
    object_uniqueness_field: ipaUniqueID
    peer_certificate: 00c3af6b-be17-4b20-a0a1-9d0b10b7ed49
    policy_engine_mode: any
    property_mappings:
    - 0ff968ba-4bad-4491-819b-0bf4c3b32d72
    - cbe46010-46e7-4159-a61e-bf8760670972
    - 40047e31-1cc4-4eaa-8d53-a88bb31fe380
    - d60fedf2-55a5-4d72-b21f-d3ccdb399f29
    - f2187f0b-da68-4f2e-b1fb-a107439d9a15
    - c443f68e-b65c-412d-8047-1acafed906fb
    property_mappings_group:
    - c443f68e-b65c-412d-8047-1acafed906fb
    server_uri: ldaps://ldap
    slug: cdedb-ldap
    sni: true
    sync_groups: true
    sync_users: true
    user_matching_mode: identifier
    user_object_filter: (objectClass=inetOrgPerson)
    user_path_template: goauthentik.io/sources/%(slug)s
  conditions: []
  id: null
  identifiers:
    pk: 23b43253-98f3-4adc-a275-7900787a3ab6
  model: authentik_sources_ldap.ldapsource
  state: present

@authentik-automation
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@septatrix
Copy link
Contributor Author

I will have to see if anything changed in recent releases

@BeryJu
Copy link
Member

BeryJu commented Apr 4, 2024

@septatrix This is fixed now when using https://goauthentik.io/blueprints/schema.json as schema and will apply to future subdomains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants