Skip to content

Commit

Permalink
feat: Introducing option to authenticate with (personal access) token…
Browse files Browse the repository at this point in the history
…, instead of username/password
  • Loading branch information
timdeluxe committed Jul 5, 2024
1 parent 3d7f95f commit 4d11d1b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions test/ConfigurationTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('The Configuration API', (): void => {
const mockServer = new MockServer('https://example.com')
mockServer.addConfigurationDocumentEndpoint()

const configuration = new Configuration('https://example.com', 'nobody', 'nothing', '12345')
const configuration = new Configuration('https://example.com', 'nobody', 'nothing', '', '12345')
await configuration.load()
chai.expect(configuration.checks).to.have.lengthOf(2)
chai.expect(configuration.checks[0].labels).to.contain('test1')
Expand All @@ -31,7 +31,7 @@ describe('The Configuration API', (): void => {
const mockServer = new MockServer('https://example.com')
mockServer.addConfigurationDocumentEndpoint()

const configuration = new Configuration('https://example.com', 'nobody', 'nothing', '12346')
const configuration = new Configuration('https://example.com', 'nobody', 'nothing', '', '12346')
await configuration.load()

chai.expect(configuration.exceptions).to.have.lengthOf(0)
Expand All @@ -40,7 +40,7 @@ describe('The Configuration API', (): void => {
const mockServer = new MockServer('https://example.com')
mockServer.addConfigurationDocumentEndpoint()

const configuration = new Configuration('https://example.com', 'nobody', 'nothing', '12347')
const configuration = new Configuration('https://example.com', 'nobody', 'nothing', '', '12347')
await configuration.load()
chai.expect(configuration.maintainer).to.have.lengthOf(1)
})
Expand Down
4 changes: 2 additions & 2 deletions test/ConfluenceTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('The Confluence API', (): void => {
const mockServer = new MockServer('https://example.com')
mockServer.addSearchEndpoint()
mockServer.addDocumentEndpoint()
const confluence = new Confluence('https://example.com', 'nobody', 'nothing')
const confluence = new Confluence('https://example.com', 'nobody', '', 'nothing')
const results = await confluence.findDocumentsOlderThan('', 1, 1)
chai.expect(results).to.have.lengthOf(2)
chai.expect(results[0].url).to.eq('https://example.com/display/SAMPLE/Test')
Expand All @@ -35,7 +35,7 @@ describe('The Confluence API', (): void => {
it('should add a configuration document', async (): Promise<void> => {
const mockServer = new MockServer('https://example.com')
mockServer.addCreateEndpoint()
const confluence = new Confluence('https://example.com', 'nobody', 'nothing')
const confluence = new Confluence('https://example.com', 'nobody', '', 'nothing')
const result = await confluence.createConfigurationDocument('example', 'test', '0123')
chai.expect(result).to.eq('12345')
})
Expand Down
8 changes: 4 additions & 4 deletions test/NotificationTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ describe('The Notification API', (): void => {
mockServer.addConfigurationDocumentEndpoint()
mockServer.addSearchEndpoint()
mockServer.addDocumentEndpoint()
configuration = new Configuration('https://example.com', 'nobody', 'nothing', '12345')
configuration = new Configuration('https://example.com', 'nobody', 'nothing', '', '12345')
await configuration.load()
confluence = new Confluence('https://example.com', 'nobody', 'nothing')
confluence = new Confluence('https://example.com', 'nobody', 'nothing', '')
transportStub = sinon.createStubInstance(Mail.prototype.constructor, {
sendMail: sinon.stub().resolves(),
}) as Mail
Expand Down Expand Up @@ -68,7 +68,7 @@ describe('The Notification API', (): void => {
).to.be.true
})
it('should use a maintainer when configured', async (): Promise<void> => {
configuration = new Configuration('https://example.com', 'nobody', 'nothing', '12347')
configuration = new Configuration('https://example.com', 'nobody', 'nothing', '', '12347')
await configuration.load()
const notification = new Notification(configuration, '', confluence, transportStub)
const documentInfo = new DocumentInfo(
Expand Down Expand Up @@ -291,7 +291,7 @@ describe('The Notification API', (): void => {
})

it('should use creator author if specified', async (): Promise<void> => {
configuration = new Configuration('https://example.com', 'nobody', 'nothing', '12348')
configuration = new Configuration('https://example.com', 'nobody', 'nothing', '', '12348')
await configuration.load()
const notification = new Notification(configuration, '', confluence, transportStub, false)
const documentInfo = new DocumentInfo(
Expand Down

0 comments on commit 4d11d1b

Please sign in to comment.