Skip to content

Conversation

alltilla
Copy link
Collaborator

@alltilla alltilla commented Sep 28, 2023

cloud-auth(): Added a new plugin for drivers, which implements different cloud related authentications.

Currently the only supported authentication is GCP's Service Account for the http() destination.

Example config:

http(
  cloud-auth(
    gcp(
      service-account(
        key("/path/to/service-account-key.json")
        audience("https://pubsub.googleapis.com/google.pubsub.v1.Publisher")
      )
    )
  )
);

Sending messages to Google Pub/Sub

The google-pubsub() destination feeds Google Pub/Sub via the HTTP REST API.

Example config:

google-pubsub(
  project("syslog-ng-project")
  topic("syslog-ng-topic")
  auth(
    service-account(
      key("/path/to/service-account-key.json")
    )
  )
);

See the Google Pub/Sub documentation to learn more about configuring a service account.

Signed-off-by: Attila Szakacs attila.szakacs@axoflow.com

@kira-syslogng
Copy link
Contributor

Build FAILURE

@alltilla alltilla force-pushed the pubsub branch 2 times, most recently from c8f38bd to 2799ff0 Compare September 28, 2023 14:34
@kira-syslogng
Copy link
Contributor

Build FAILURE

@kira-syslogng
Copy link
Contributor

Build FAILURE

Copy link
Collaborator

@MrAnno MrAnno left a comment

Choose a reason for hiding this comment

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

LGTM so far 👍

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
https://github.com/Thalhammer/jwt-cpp

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Exampel config:

google-pubsub(
  project("test-project-389014")
  topic("syslog-ng-test")
  auth(
    service-account(
      key("/path/to/test-project-389014-64d0bf69bec7.json")
      audience("https://pubsub.googleapis.com/google.pubsub.v1.Publisher")
    )
  )
);

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
It is useful to set default values for some options.
For example setting the service-account(audience()) in an SCL.

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
So the user does not have to set it manually.

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
@alltilla alltilla force-pushed the pubsub branch 2 times, most recently from 7cb41a6 to d9d7b25 Compare October 2, 2023 11:04
@alltilla
Copy link
Collaborator Author

alltilla commented Oct 2, 2023

I have fixed the review comments, modified a bit on the configurability and added news entries. This is ready for review again. @MrAnno @furiel Could you kindly take a look again? Thanks!

Necessary for idempotency in case of a config revert.

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
The lifecycle management of the cpp object must be done in init()
and deinit(), so we can be idempotent.

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
@alltilla
Copy link
Collaborator Author

alltilla commented Oct 2, 2023

Sry, pushed again.

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.

5 participants