Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
AWS Cognito and Row Level Security in RDS PostgreSql

I have two B2B apps, one for suppliers and the other for purchasers. The supplier app is a .NET Core app fully hosted in AWS, users are authenticated in Cognito, API gateway is used, RDS, ECS, etc. The second app is older and not hosted in AWS. The AWS app owns the REST API and the other app needs to leverage that API for certain things. I'd like to setup row-level security in Postgres so that queries made by suppliers filter by supplier_id and the ones made by purchasers filter by purchaser_id. My understanding is that the best way to do RLS is to use Postgres settings/variables and then have your policy leverage something like current_setting('app.supplier_id') or current_setting('app.purchaseorder_id') to filter the data. I'm just not sure how to tie all this together.

The simple way that comes to mind is to setup an app client in Cognito and enable client credentials grant type, then the second app could leverage that to get a token. When a request to the API is made, a middleware would check the JWT token and use a different account based on if it's a supplier or purchaser accessing. It would then also set an app.supplier_id or app.purchaser_id on the Postgres connection and the RLS would take care of the rest. I'm just not sure this is the best approach or if there would be a more elegant way.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda