Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nclabs/rpc-config

Package Overview
Dependencies
Maintainers
0
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nclabs/rpc-config

Em testes

  • 0.0.5
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

Senior Auth

reescrever...

Microsserviço conector de serviços Rest -> G5 (SOAP) para ser uilizado em aplicações NestJS.



Pré-requisitos

  • Docker
  • Container Nats


Variáveis de ambiente necessárias

# ######################################################################### # 
#                                   NATS                                    #
# ######################################################################### # 
NATS_HOST=cassandra-nats
NATS_PORT=4223

#---------------------------------------------------------------------------------------#
#                                      SENIOR                                           #
#---------------------------------------------------------------------------------------#
G5_BASE_URL=https://<server>:<port>/g5-senior-services/


Docker Compose

version: '3.3'

services:
  <your_G5_SENIOR_SERVICES_NAME>:
    image: ncinfo/nestjs-g5-senior-services:tagname
    container_name: <your_container_name>
    env_file:
      - <your_env_file>
    environment:
      G5_SENIOR_SERVICES_NAME: g5-senior-services  ## mesmo nome deve ser indicado no descritor de serviços do api-gateway
    restart: unless-stopped
    networks:
      - <your_network>
    
networks:
  <your_network>:
    # external: true      
    driver: bridge


Como utilizar

Credenciais

Para autenticar no Senior G5 são utilizados os parâmetros username, password e encryption que devem ser enviados como headers da chamada.


REST

IMPORTANTE

Implementar no gateway o tratamento das credenciais para as requisições REST.


GET

GET <api_url>/<api_base_path>/g5-senior-services/:module/:webservice/:port

GET com parâmetros

GET <api_url>/<api_base_path>/g5-senior-services/:module/:webservice/:port?param1=val&param2=val

POST


POST <api_url>/<api_base_path>/g5-senior-services/:module/:webservice/:port

body {
  param1: "value",
  param2: "value",
  param3: {
    detail1: value,
    ...
  }
}


SEND MESSAGE


const headers = nats.headers();
headers.set('username', '<usuario-G5>');
headers.set('password', '<senha-G5>');
headers.set('encryption', '<tipo-criptografia>');  // 1, 2 ou 3

const payload = {
  module: "module",
  webservice: "webservice",
  port: "port",
  parameters: {
    params1: value,
    params2: value,
    param3: {
      detail1: value,
      ...
    }
  }
}

const record = new NatsRecordBuilder(payload)
      .setHeaders(headers)
      .build();

return this.client.send("g5-senior-services.exec", record);



Projeto

https://github.com/ncinfo/nestjs-g5-senior-services

FAQs

Package last updated on 05 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc