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

Authorization model returning "invalid: no entrypoints defined" error #1475

Open
6 tasks done
tylernix opened this issue Mar 20, 2024 · 0 comments
Open
6 tasks done
Labels
bug Something isn't working

Comments

@tylernix
Copy link

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of OpenFGA and the issue still persists.
  • I have searched the OpenFGA Community and have not found a suitable solution or answer.
  • I agree to the terms within the OpenFGA Code of Conduct.

Description

A valid model returns an error error running tests due to rpc error: code = Code(2056) desc = the definition of relation 'can_purchase' in object type 'card' is invalid: no entrypoints defined

The DSL seems to parse correctly (CLI transforms it and VS Code shows no validation errors), but the server still returns an error.

Expectation

Tests run successfully on this model.

Reproduction

Run > fga model test --tests stripe.fga.yaml in console

Store data

stripe.fga.yaml model

model: |
  model
    schema 1.1

  # Stripe Core Module
  type user

  type account
    relations
      define owner: [user]
      define admin: [user] or owner
      define iam_admin: [user] or admin
      define developer: [user] or admin
      define transfer_analyst: [user] or admin
      define view_only: [user] or admin
      define transfer_analyst_in_test_mode: transfer_analyst but not transfer_analyst from test_mode # intermediate relations, just used for evaluating other relations
      
      define card: [card] # dual-writes relationships, when you need to traverse relations on two types both ways (starting at card up or account down)
      define cardholder: cardholder from card 
      define cardholder_in_test_mode: cardholder but not cardholder from test_mode    

      define test_mode: [account]

      define can_close_account: owner
      define can_change_owner: owner
      define can_invite: iam_admin
      define can_add_bank_account: admin but not admin from test_mode # exclusion operator
      define can_delete_default_bank_account: owner

  type bank_account
    relations
      define account: [account]
      define can_delete_bank_account: admin from account
      define can_view: admin from account
      define can_transfer_balance: transfer_analyst from account but not transfer_analyst_in_test_mode from account

  # Stripe Payments Module
  type payment
  type subscription
  type invoice

  # Stripe Issuing Module
  type card
    relations
      define account: [account]
      define cardholder: [user]
      define digital_wallet: [digital_wallet]
      define active: [card]
      define can_purchase: cardholder from active but not cardholder_in_test_mode from account
      define can_view_transactions: cardholder or admin from account
      define spending_limit_policy: [card#cardholder with spending_limit]
  
  type transaction 
    relations
      define card: [card]
      define can_view: can_view_transactions from card

OpenFGA version

just testing model

How are you running OpenFGA?

In Docker

What datastore are you using?

In-Memory

OpenFGA Flags

n/a

Logs

No response

@tylernix tylernix added the bug Something isn't working label Mar 20, 2024
@tylernix tylernix changed the title Authorization Model returning "invalid: no entrypoints defined" error Authorization model returning "invalid: no entrypoints defined" error Mar 20, 2024
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

No branches or pull requests

1 participant