From 0cd100abd31531d9e74830a4bd3f60ec67f1b8ab Mon Sep 17 00:00:00 2001 From: Matt Dainty Date: Fri, 8 Jan 2021 17:26:38 +0000 Subject: [PATCH] Update README [ci skip] --- README.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9dcaf44..086f156 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Version](https://img.shields.io/github/v/tag/bodgit/tsig)](https://github.com/bodgit/tsig/tags) +[![GitHub release](https://img.shields.io/github/v/release/bodgit/tsig)](https://github.com/bodgit/tsig/releases) [![Build Status](https://img.shields.io/github/workflow/status/bodgit/tsig/build)](https://github.com/bodgit/tsig/actions?query=workflow%3Abuild) [![Coverage Status](https://coveralls.io/repos/github/bodgit/tsig/badge.svg?branch=master)](https://coveralls.io/github/bodgit/tsig?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/bodgit/tsig)](https://goreportcard.com/report/github.com/bodgit/tsig) @@ -84,3 +84,37 @@ func main() { } } ``` + +If you need to deal with both regular TSIG and GSS-TSIG together then this +package also exports an HMAC TSIG implementation. To use both together set +your client up something like this: + +```golang +package main + +import ( + "github.com/bodgit/tsig" + "github.com/bodgit/tsig/gss" + "github.com/miekg/dns" +) + +func main() { + dnsClient := new(dns.Client) + dnsClient.Net = "tcp" + + // Create HMAC TSIG provider + hmac := tsig.HMAC{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} + + // Create GSS-TSIG provider + gssClient, err := gss.NewClient(dnsClient) + if err != nil { + panic(err) + } + defer gssClient.Close() + + // Configure DNS client with both providers + dnsClient.TsigProvider = tsig.MultiProvider(hmac, gssClient) + + // Use the DNS client as normal +} +```