dalibo / dalibo/ldap2pg

Message about invalid credentials with "{}" in config

Open
#758 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
236
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Hi! For some reason, when using the "something{something_else}" construct in "roles/names", I get an error about invalid credentials.

ldap2pg.yml

Good config:

version: 6

postgres:
  databases_query: [postgres]

privileges:
  ro:
  - __connect__
  - __select_on_tables__
  - __select_on_sequences__
  - __usage_on_schemas__
  - __usage_on_types__

  rw:
  - __temporary__
  - __all_on_tables__
  - __all_on_sequences__

  ddl:
  - __create_on_schemas__

rules:
- description: "..."
  ldapsearch:
    base: cn=admin,dc=test,dc=com
    filter: ""

- description: "Setup static roles and grants."
  roles:
  - names:
    - readers
    options: NOLOGIN
  - name: writers
    parent: readers
    options: NOLOGIN
  - name: owners
    parent: writers
    options: NOLOGIN

  - names:
    - AA
    options: NOLOGIN

  grant:
  - privilege: ro
    role: readers
  - privilege: rw
    role: writers
  - privilege: ddl
    role: owners

However, when I change AA to AA{}, I get an error:

  - names:
    - AA{} # or "AA{}"
    options: NOLOGIN

Expectations

I don't quite understand why this is happening, but I think it looks like a bug.

Verbose output of ldap2pg execution

Verbose output Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the supplied ldap2pg.yml, comparing the working AA value with AA{} and reviewing the attached verbose output. Trace how the names value is interpreted before the invalid-credentials error; done means the behavior is corrected or clearly explained for names containing {}.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.