Pesquisar

質問
· 2 hr 前

Error when connecting via CacheExtreme

I'm following this guide as well as the sample.cs file and getting an error message on this line

cache_connection.Connect();

The error is:

Caught GlobalsException: lc_conn::connect_device returned Db_err: source: lc_conn::connect()  message: lc_conn::connect: CacheSecureStart returned -15: <ACCESSDENIED>

I've tried many variations of Namespace + Username + Password and they all result in that error, even though I can connect to the namespace just fine using other means. 

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
記事
· 4 hr 前 2m read

asaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsa

 asaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsa

asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsa

 asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa

asaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsa

asaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsa

asaasdasdasdasdasdasdasdsa asaasdasdasdasdasdasdasdsaasaasdasdasdasdasdasdasdsa

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
記事
· 4 hr 前 8m read

Python IAM/KONG configuration export/import tool

 


🛠️ Managing KONG Configurations in CI/CD with InterSystems IRIS IAM

🔍 Context: InterSystems IRIS IAM & Kong Gateway

As part of integrating InterSystems IRIS into a secure and controlled environment, InterSystems IRIS IAM relies on Kong Gateway to manage exposed APIs. Kong acts as a modern API Gateway, capable of handling authentication, security, traffic management, plugins, and more.

However, maintaining consistent Kong configurations (routes, services, plugins, etc.) across different environments (development, testing, production) is a major challenge. This is where tools like deck and this Python script become highly valuable.


⚙️ Overview of kong_config_tool.py

This tool allows you to:

  • Export the current configuration of a KONG Gateway into a versionable YAML file.
  • Import a YAML configuration into a KONG Gateway (via deck sync).
  • Automate full logging (logs, stdout/stderr) for accurate tracking.
  • Easily integrate into a CI/CD pipeline.

🎯 Goals and Benefits

🔄 Consistent Synchronization Across Environments

The tool simplifies propagating KONG configuration between environments. By exporting from dev and importing into staging or prod, you ensure functional parity.

🔐 Traceability and Audits via Logs

With the --log option, all operations (including internal deck commands) are logged:

  • Who executed what
  • What configuration was applied
  • What was Kong’s response (number of resources created, modified, etc.)

🧪 CI/CD Pipeline Integration

In GitLab CI, GitHub Actions, or Jenkins:

  • The export step can be triggered automatically after API changes.
  • The import step can deploy the Kong config on every merge or release.
  • The generated YAML files can be version-controlled in Git.

🧰 Example GitLab Pipeline

stages:
  - export
  - deploy

export_kong:
  stage: export
  script:
    - python3 kong_config_tool.py --export --log export.log
  artifacts:
    paths:
      - kong.yaml
      - export.log

deploy_kong:
  stage: deploy
  script:
    - python3 kong_config_tool.py --import --log deploy.log

🛡️ Security and Reproducibility

Since InterSystems IRIS IAM is often used in sensitive environments (healthcare, finance...), it’s essential to:

  • Avoid manual errors using deck sync
  • Ensure each deployment applies the exact same configuration
  • Maintain a clear audit trail via .log files

💡 Tool Highlights

Feature Description
--export Saves the current config to a file like kong-<timestamp>.yaml
--import Applies the contents of kong.yaml to the Gateway
--log Enables full logging (stdout, stderr, logs)
Automatic Symlink kong.yaml is always a symlink to the latest exported version
Easy Integration No heavy dependencies — relies on standard Python and deck

📦 Conclusion

The kong_config_tool.py script is a key component for industrializing KONG configuration management in the context of InterSystems IRIS IAM. It enables:

  • Better configuration control
  • Enhanced traceability
  • Smooth integration into CI/CD pipelines
  • Compliance with security requirements

🚀 Potential Future Enhancements

  • Native GitOps integration (ArgoCD, FluxCD)
  • Configuration validation with deck diff
  • Error notifications (Slack, Teams)

🧬 Python Code Overview

The kong_config_tool.py script is a Python CLI tool designed to automate configuration exports and imports for KONG Gateways using deck, while ensuring robust logging.


📁 General Structure

#!/usr/bin/env python3

import argparse
import subprocess
from datetime import datetime
from pathlib import Path
import sys
import logging
  • Uses only standard Python modules.
  • argparse: to handle command-line options.
  • subprocess: to run deck commands.
  • logging: for structured output (console + file).

🧱 Logger Initialization

logger = logging.getLogger("kong_config_tool")
  • Initializes a named logger, configurable based on whether a log file is requested.

📝 setup_logging(log_file=None)

This function:

  • Creates handlers for both console and/or file.
  • Redirects sys.stdout and sys.stderr to the log file if --log is provided.

🔎 This captures everything: Python logs, print(), errors, and also output from deck.


📤 export_kong_config()

deck_dir = Path.cwd()
output_file = deck_dir / f"kong-{timestamp}.yaml"
  • Executes deck gateway dump -o ... to export the current configuration.
  • Captures stdout and stderr and sends them to logger.debug(...).
  • Creates or updates a kong.yaml symlink pointing to the exported file — simplifying future imports.
  • Logs and exits on failure.

📥 import_kong_config()

  • Checks for the presence of the kong.yaml file (symlink or actual file).
  • Runs deck gateway sync kong.yaml.
  • Captures and logs full output.
  • Handles errors via CalledProcessError.

🔁 This logic mirrors the export process.


🚀 main()

The main entry point that:

  • Handles --export, --import, and --log arguments.
  • Calls the appropriate functions.

Example usage:

python kong_config_tool.py --export --log export.log
python kong_config_tool.py --import --log import.log

💡 If --log is omitted, output goes to console only.


🧪 Typical CI/CD Execution

Export

python kong_config_tool.py --export --log export.log

Results:

  • kong-2025-07-18_12-34-56.yaml (versionable content)
  • kong.yaml (useful symlink for import)
  • export.log (audit log)

Import

python kong_config_tool.py --import --log import.log

Results:

  • Applies the configuration to a new gateway (staging, prod, etc.)
  • import.log to prove what was done

✅ Code Summary Table

Feature Implementation
Intuitive CLI Interface argparse with help descriptions
Clean Export deck gateway dump + timestamp
Controlled Import deck gateway sync kong.yaml
Full Logging logging + stdout/stderr redirection
Resilience Error handling via try/except
CI/CD Ready Simple interface, no external dependencies

Let me know if you'd like the English version of the actual code too!

 
Spoiler

 

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
ディスカッション (1)2
続けるにはログインするか新規登録を行ってください
記事
· 4 hr 前 11m read

Outil Python d'export / import de configuration IAM / KONG

 


🛠️ Gérer les configurations KONG en CI/CD avec InterSystems IRIS IAM

🔍 Contexte : InterSystems IRIS IAM & Kong Gateway

Dans le cadre de l'intégration d'InterSystems IRIS dans un environnement sécurisé et contrôlé, InterSystems IRIS IAM repose sur Kong Gateway pour gérer les API exposées. Kong agit comme un API Gateway moderne, capable de gérer l’authentification, la sécurité, la gestion du trafic, les plugins, et bien plus encore.

Cependant, maintenir une configuration cohérente de Kong (routes, services, plugins...) entre les différents environnements (développement, test, production) est un défi majeur. C’est ici que les outils comme deck et ce script Python prennent tout leur sens.


⚙️ Présentation de kong_config_tool.py

Cet outil permet de :

  • Exporter la configuration actuelle d’un Gateway KONG dans un fichier YAML versionnable.
  • Importer une configuration YAML dans un Gateway KONG (via deck sync).
  • Automatiser la journalisation complète (logs, stdout/stderr) pour un suivi précis.
  • S’intégrer facilement dans un pipeline CI/CD.

🎯 Objectifs et bénéfices

🔄 Synchronisation cohérente entre environnements

L’outil facilite la propagation de la configuration KONG entre les environnements. En exportant la configuration de dev, puis en l’importation dans staging ou prod, vous assurez une parité fonctionnelle.

🔐 Traçabilité et audits via logs

Grâce à l’option --log, toutes les opérations (y compris les commandes internes à deck) sont journalisées :

  • Qui a exécuté quoi
  • Quelle configuration a été appliquée
  • Quelle a été la réponse de Kong (nombre de ressources créées, modifiées...)

🧪 Intégration dans des pipelines CI/CD

Dans GitLab CI, GitHub Actions ou Jenkins :

  • L’étape d’export peut être lancée automatiquement après des modifications d’API.
  • L’étape d’import permet de déployer automatiquement la config Kong à chaque merge ou release.
  • Les fichiers YAML générés peuvent être versionnés dans Git.

🧰 Exemple typique de pipeline GitLab

stages:
  - export
  - deploy

export_kong:
  stage: export
  script:
    - python3 kong_config_tool.py --export --log export.log
  artifacts:
    paths:
      - kong.yaml
      - export.log

deploy_kong:
  stage: deploy
  script:
    - python3 kong_config_tool.py --import --log deploy.log

🛡️ Sécurité et reproductibilité

InterSystems IRIS IAM étant souvent utilisé dans des environnements sensibles (santé, finance...), il est essentiel de :

  • Éviter les erreurs manuelles via deck sync
  • Garantir que chaque déploiement applique exactement la même configuration
  • Disposer d’un journal clair pour les audits (via les fichiers .log)

💡 Points forts de l’outil

Fonction Description
--export Sauvegarde la config actuelle vers un fichier kong-<timestamp>.yaml
--import Applique le contenu de kong.yaml dans le Gateway
--log Active la journalisation complète (stdout, stderr, logs)
Symlink automatique Le fichier kong.yaml est toujours un alias vers la dernière version exportée
Intégration facile Aucune dépendance lourde, tout repose sur Python standard et deck

📦 Conclusion

L’outil kong_config_tool.py est une brique essentielle pour industrialiser la gestion des configurations KONG dans le contexte d’InterSystems IRIS IAM. Il permet :

  • Un meilleur contrôle de la configuration.
  • Une meilleure traçabilité.
  • Une intégration fluide dans les pipelines CI/CD.
  • Une mise en conformité avec les exigences de sécurité.

🚀 Prochaines évolutions possibles

  • Intégration native à GitOps (ArgoCD, FluxCD)
  • Validation de configuration avec deck diff
  • Notifications en cas d’erreurs (Slack, Teams)

 

Voici une présentation détaillée du code Python kong_config_tool.py, intégrée à l’article, pour expliquer son fonctionnement ligne par ligne, et comment il s’inscrit dans une démarche de CI/CD et d'administration de la configuration KONG avec InterSystems IRIS IAM.


🧬 Présentation du code Python

Le script kong_config_tool.py est un outil en ligne de commande Python conçu pour automatiser les exports et imports de configuration du Gateway KONG via deck, tout en assurant une journalisation robuste.


📁 Structure générale

#!/usr/bin/env python3

import argparse
import subprocess
from datetime import datetime
from pathlib import Path
import sys
import logging
  • Utilise uniquement des modules standards Python.
  • argparse : pour gérer les options en ligne de commande.
  • subprocess : pour exécuter deck.
  • logging : pour un logging structuré (console + fichier).

🧱 Initialisation du logger

logger = logging.getLogger("kong_config_tool")
  • Initialise un logger nommé, configurable selon qu’un fichier log est demandé ou non.

📝 setup_logging(log_file=None)

Fonction permettant :

  • de créer des handlers vers console et/ou fichier.
  • de rediriger sys.stdout et sys.stderr vers le fichier si --log est fourni.

🔎 Permet ainsi de capturer tout : logs Python, print(), erreurs, et aussi sortie de deck.


📤 export_kong_config()

deck_dir = Path.cwd()
output_file = deck_dir / f"kong-{timestamp}.yaml"
  1. Exécute deck gateway dump -o ... pour exporter la configuration actuelle de Kong.
  2. Capture stdout et stderr pour les injecter dans le log via logger.debug(...).
  3. Crée (ou met à jour) un symlink kong.yaml qui pointe vers le fichier exporté — cela simplifie les imports ultérieurs.
  4. En cas d’échec, affiche l’erreur dans les logs et arrête le script.

📥 import_kong_config()

  1. Vérifie la présence du fichier kong.yaml (symlink ou vrai fichier).
  2. Exécute deck gateway sync kong.yaml.
  3. Capture la sortie complète et la logge également.
  4. Gestion fine des erreurs via CalledProcessError.

🔁 Cette logique est symétrique à l’export.


🚀 main()

Fonction d’entrée qui :

  • Gère les arguments --export, --import, --log.
  • Appelle les fonctions correspondantes.
python kong_config_tool.py --export --log export.log
python kong_config_tool.py --import --log import.log

💡 Si --log est omis, la sortie reste visible dans la console uniquement.


🧪 Exécution typique en pipeline CI/CD

Export

python kong_config_tool.py --export --log export.log

Résultat :

  • kong-2025-07-18_12-34-56.yaml (contenu versionnable)
  • kong.yaml (symlink utile pour l’import)
  • export.log (journal pour audit)

Import

python kong_config_tool.py --import --log import.log

Résultat :

  • Application de la configuration sur un nouveau gateway (staging, prod, etc.)
  • Fichier import.log pour prouver ce qui a été fait

✅ Résumé des points du code

Fonctionnalité Implémentation
Interface CLI intuitive argparse avec aide en ligne
Export propre deck gateway dump + timestamp
Import contrôlé deck gateway sync kong.yaml
Journalisation complète logging + redirection stdout/stderr
Résilience Gestion des erreurs via try/except
Intégration CI/CD ready Interface simple, sans dépendance externe
 
 
Spoiler

 

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください