Skip to content

Conversation

shakeelrao
Copy link
Contributor

@shakeelrao shakeelrao commented May 13, 2024

Add support for creating namespaces with API key authentication / optional mTLS.

Example configurations w/ Go:

// Create a "restricted" NS (no auth method specified).
ns := &namespace.NamespaceSpec{
  Name:  name,
  Regions: regions,
  MtlsAuth: &namespace.MtlsAuthSpec{}, /* or omitted */
  ApiKeyAuth: &namespace.ApiKeyAuthSpec{}, /* or omitted */
  RetentionDays: retention,
}

// Create a NS with mTLS auth.
ns := &namespace.NamespaceSpec{
  Name:  name,
  Regions: regions,
  MtlsAuth: &namespace.MtlsAuthSpec{
    AcceptedClientCa: clientCA,
    Enabled: true,
  },
  ApiKeyAuth: &namespace.ApiKeyAuthSpec{}, /* or omitted */
  RetentionDays: retention,
}

// Create a NS with API keys auth.
ns := &namespace.NamespaceSpec{
  Name:  name,
  Regions: regions,
  MtlsAuth: &namespace.MtlsAuthSpec{}, /* or omitted */
  ApiKeyAuth: &namespace.ApiKeyAuthSpec{
    Enabled: true,
  },
  RetentionDays: retention,
}

// Create a NS with mTLS and API key auth.
ns := &namespace.NamespaceSpec{
  Name:  name,
  Regions: regions,
  MtlsAuth: &namespace.MtlsAuthSpec{
    AcceptedClientCa: clientCA,
    Enabled: true,
  },
  ApiKeyAuth: &namespace.ApiKeyAuthSpec{
    Enabled: true,
  },
  RetentionDays: retention,
}

@shakeelrao shakeelrao requested review from tminusplus and cretz May 13, 2024 20:51
@@ -3,7 +3,7 @@ deps:
- buf.build/googleapis/googleapis
breaking:
use:
- FILE
- WIRE
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temporary change to pass CI, will revert after.

@shakeelrao shakeelrao merged commit a429e6c into main May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants