Skip to content

Commit

Permalink
chore: add no auth client credential provider
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 committed Dec 4, 2024
1 parent 013178d commit a9826ba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/credential_provider/CredentialProvider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import AuthStrategy from "../auth_strategy/AuthStrategy";

export default abstract class CredentialProvider {
private authType: string;
protected constructor(authType: string) {
this.authType = authType;
}
abstract toAuthStrategy(): AuthStrategy;
}
17 changes: 17 additions & 0 deletions src/credential_provider/NoAuthCredentialProvider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import CredentialProvider from "./CredentialProvider";
import AuthStrategy from "../auth_strategy/AuthStrategy";
import NoAuthStrategy from "../auth_strategy/NoAuthStrategy";

namespace NoAuthCredentialProvider {
export class NoAuthCredentialProvider extends CredentialProvider {
constructor() {
super("client-credentials");
}

public toAuthStrategy(): AuthStrategy {
return new NoAuthStrategy();
}
}
}

export = NoAuthCredentialProvider;

0 comments on commit a9826ba

Please sign in to comment.