Skip to content

Commit

Permalink
Merge pull request #19846 from RubenV-dev/pinniped-auth
Browse files Browse the repository at this point in the history
Pinniped Auth Provider
  • Loading branch information
Jamie Klassen committed Oct 13, 2023
2 parents 0a94258 + 2f172ba commit e0b5cd9
Show file tree
Hide file tree
Showing 17 changed files with 1,223 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-ears-rescue.md
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend-module-pinniped-provider': minor
---

Add new Pinniped auth module and authenticator to be used alongside the new Pinniped auth provider.
5 changes: 5 additions & 0 deletions .changeset/young-ducks-heal.md
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-node': patch
---

Adding optional audience parameter to OAuthState type declaration
1 change: 1 addition & 0 deletions plugins/auth-backend-module-pinniped-provider/.eslintrc.js
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
7 changes: 7 additions & 0 deletions plugins/auth-backend-module-pinniped-provider/README.md
@@ -0,0 +1,7 @@
# Auth Module: Pinniped Provider

This module provides an Pinniped auth provider implementation for `@backstage/plugin-auth-backend`.

## Links

- [Backstage](https://backstage.io)
28 changes: 28 additions & 0 deletions plugins/auth-backend-module-pinniped-provider/api-report.md
@@ -0,0 +1,28 @@
## API Report File for "@backstage/plugin-auth-backend-module-pinniped-provider"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { BaseClient } from 'openid-client';
import { OAuthAuthenticator } from '@backstage/plugin-auth-node';
import { Strategy } from 'openid-client';
import { TokenSet } from 'openid-client';

// @public (undocumented)
export const authModulePinnipedProvider: () => BackendFeature;

// @public (undocumented)
export const pinnipedAuthenticator: OAuthAuthenticator<
Promise<{
providerStrategy: Strategy<
{
tokenset: TokenSet;
},
BaseClient
>;
client: BaseClient;
}>,
unknown
>;
```
10 changes: 10 additions & 0 deletions plugins/auth-backend-module-pinniped-provider/catalog-info.yaml
@@ -0,0 +1,10 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: backstage-plugin-auth-backend-module-pinniped-provider
title: '@backstage/plugin-auth-backend-module-pinniped-provider'
description: The pinniped-provider backend module for the auth plugin.
spec:
lifecycle: experimental
type: backstage-backend-plugin-module
owner: maintainers
26 changes: 26 additions & 0 deletions plugins/auth-backend-module-pinniped-provider/dev/index.ts
@@ -0,0 +1,26 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { createBackend } from '@backstage/backend-defaults';
import authPlugin from '@backstage/plugin-auth-backend';
import { authModulePinnipedProvider } from '../src';

const backend = createBackend();

backend.add(authPlugin);
backend.add(authModulePinnipedProvider);

backend.start();
49 changes: 49 additions & 0 deletions plugins/auth-backend-module-pinniped-provider/package.json
@@ -0,0 +1,49 @@
{
"name": "@backstage/plugin-auth-backend-module-pinniped-provider",
"description": "The pinniped-provider backend module for the auth plugin.",
"version": "0.0.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "backend-plugin-module"
},
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/plugin-auth-node": "workspace:^",
"openid-client": "^5.4.3"
},
"devDependencies": {
"@backstage/backend-defaults": "workspace:^",
"@backstage/backend-test-utils": "workspace:^",
"@backstage/cli": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/plugin-auth-backend": "workspace:^",
"cookie-parser": "^1.4.6",
"express": "^4.18.2",
"express-promise-router": "^4.1.1",
"express-session": "^1.17.3",
"jose": "^4.14.6",
"msw": "^1.3.0",
"passport": "^0.6.0",
"supertest": "^6.3.3"
},
"files": [
"dist"
]
}

0 comments on commit e0b5cd9

Please sign in to comment.