Skip to content

TransformJSONProtoToDSL fails for models with direct assignments #620

Description

@ErlingWis

TransformJSONProtoToDSL can fail when given an AuthorizationModel produced by TransformModuleFilesToModel, even though the
model represents valid DSL.

reproduce

user := `
  module user

  type user
  `

group := `
  module group

  type group
    relations
      define member: [user]
  `

  model, err := transformer.TransformModuleFilesToModel([]transformer.ModuleFile{
      {Name: "user.fga", Contents: user},
      {Name: "group.fga", Contents: group},
  }, "1.2")
  if err != nil {
      panic(err)
  }

  _, err = transformer.TransformJSONProtoToDSL(
      model,
      transformer.WithIncludeSourceInformation(true),
  )

my expectation was that this would return the full compiled DSL model, similar to the output of the FGA cli fga model transform

but it fails with

the 'member' relation definition under the 'group' type is not supported by the OpenFGA DSL syntax yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Intake

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions