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

spring-config-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spring-config-client

A client for Spring Config Server

  • 1.0.0
  • PyPI
  • Socket score

Maintainers
1

spring-config-client

A Python client for Spring Config Server.

This library is inspired by amenezes/config-client and is essentially a toned-down fork that I customized to fit my own needs.

Project goals

  • Provide a basic client
  • Provide basic authentication
  • Add support for CloudFoundry

Installation

Install using pip

$ pip install spring-config-client

Usage

The very basic usage of this library looks like this:

from spring_config import ClientConfigurationBuilder
from spring_config.client import SpringConfigClient

config = ClientConfigurationBuilder().app_name("test-application").build()

c = SpringConfigClient(config)
c.get_config()

By default, ClientConfigurationBuilder builds a ClientConfiguration object with server address and application profile set to http://localhost:8888 and development. These can be changed like this:

Here are some examples:

# Fetch from http://someserver.com using profile "development"
config = (
    ClientConfigurationBuilder()
    .app_name("test-application")
    .address("http://someserver.com")
    .build()
)

# Fetch from http://someserver.com using profile "production"
config = (
    ClientConfigurationBuilder()
    .app_name("test-application")
    .address("http://someserver.com")
    .profile("production")
    .build()
)

Authentication

If your configuration server requires to use basic authentication, you can create the client configuration like this:

from spring_config import ClientConfigurationBuilder

config = (
    ClientConfigurationBuilder()
    .app_name("test-application")
    .authentication(("username", "password"))
    .build()
)

Configuration options

The ClientConfigurationBuilder allow controlling these parameters.

  • Application Name : app_name("some-app") - Default None, required.
  • Server Address : address("http://some-server") - Default http://localhost:8888, optional.
  • Profile : profile("production") - Default development, optional.
  • Branch : branch("devel/0.1") - Default master, optional.

Requesting features

Please use the issues section to request new features and I will try to take out my time to work on them. Contributions in any sorts are always welcome :)

FAQs


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