Skip to content

Version 2.0.07 - Token Refresh

Latest
Compare
Choose a tag to compare
@lux4rd0 lux4rd0 released this 27 Jun 16:27
· 3 commits to main since this release
d0520ea

Release Notes

Enhancements

  • Added periodic token renewal functionality:
    • Implemented renew_token and periodic_token_renewal methods in SenseCollector to handle automatic token renewal at every specified interval.
      The token renewal interval is set to 12 hours (43200 seconds) by default, but it can be customized via environment variables.
    • Logging added to track token renewal actions and intervals.

Bug Fixes

  • Fixed issue with environment variable comparison:
    • Corrected logic for case-insensitive comparison of environment variables to ensure proper detection of custom values.
    • Resolved issue where token renewal interval (SENSE_COLLECTOR_API_TOKEN_RENEW) was obscured incorrectly.

Logging Improvements

  • Improved logging in main function:
    • Added debug logs for each step in the main function to provide detailed tracing of the initialization process.
    • Enhanced logging messages for authentication and environment variable retrieval.
    • Added logging for individual tasks within the asyncio.gather call to ensure visibility into task startup.

Docker and Build Script Adjustments

  • Updated Dockerfile for new directory structure:
    • Moved Dockerfile to a parent directory and adjusted paths to copy necessary files from the src directory properly.
  • Refined build script:
    • Transitioned build script from bash to Python for better readability and error handling.
    • Ensured real-time output during the build and push commands using subprocess.Popen for command execution.

New Environment Variables

  • SENSE_COLLECTOR_API_TOKEN_RENEW:
    • Interval in seconds for token renewal. Default set to 43200 seconds (12 hours).

General Improvements

  • Improved error handling and robustness:
    • Added error handling for all subprocess calls within the build script to ensure proper reporting and exit on failure.
    • Enhanced visibility into Docker build and push processes by merging stdout and stderr streams and ensuring immediate output flushing.

Documentation Updates

  • Updated README and examples:
    • Examples of new environment variables and their usage were included.
    • Added documentation for new token renewal functionality and configuration.