Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplication/plugin-dotnet-auth-core-identity

Package Overview
Dependencies
Maintainers
7
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplication/plugin-dotnet-auth-core-identity - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

src/types.ts

5

.amplicationrc.json
{
"settings": {}
"settings": {
"seedUserEmail": "test@email.com",
"seedUserPassword": "P@ssw0rd!"
}
}

2

package.json
{
"name": "@amplication/plugin-dotnet-auth-core-identity",
"version": "0.0.2",
"version": "0.0.3",
"description": "Add Authentication and Authorization to your .NET Services",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -0,4 +1,13 @@

import { dotnetTypes } from "@amplication/code-gen-types";
import { CodeBlock, CsharpSupport } from "@amplication/csharp-ast";
import { getPluginSettings } from "../utils";
export function CreateSeedDevelopmentDataBody(resourceName: string): CodeBlock {
export function CreateSeedDevelopmentDataBody(
resourceName: string,
context: dotnetTypes.DsgContext
): CodeBlock {
const { seedUserEmail, seedUserPassword } = getPluginSettings(
context.pluginInstallations
);
return new CodeBlock({

@@ -27,7 +36,14 @@ references: [

var user = new IdentityUser { Email = "test@email.com", UserName = "admin" };
var usernameValue = "${seedUserEmail}";
var passwordValue = "${seedUserPassword}";
var user = new IdentityUser
{
Email = usernameValue,
UserName = usernameValue,
NormalizedUserName = usernameValue.ToUpperInvariant(),
NormalizedEmail = usernameValue.ToUpperInvariant(),
};
var password = new PasswordHasher<IdentityUser>();
var hashed = password.HashPassword(user, "password");
var hashed = password.HashPassword(user, passwordValue);
user.PasswordHash = hashed;

@@ -47,41 +63,1 @@ var userStore = new UserStore<IdentityUser>(context);

}
// const authEntityDto = (entities: Entity[]): string => {
// let codeBlock = "";
// for (const field of fields) {
// const fieldNamePascalCase = pascalCase(field.name);
// if (field.dataType == EnumDataType.Lookup) {
// const relatedEntity = entities.find(
// (entity) => entity.id === field.properties?.relatedEntityId
// );
// const relatedEntityFieldName = pascalCase(field.name);
// if (field.properties?.allowMultipleSelection) {
// // the "many" side of the relation
// codeBlock =
// codeBlock +
// `${fieldNamePascalCase} = model.${relatedEntityFieldName}.Select(x => new ${relatedEntity?.name}IdDto {Id = x.Id}).ToList(),\n`;
// } else {
// if (field.properties.fkHolderName === authEntity.name) {
// break;
// } else {
// // the "one" side of the relation
// codeBlock =
// codeBlock +
// `${fieldNamePascalCase} = new ${relatedEntity?.name}IdDto { Id = model.${fieldNamePascalCase}Id},\n`;
// }
// }
// } else {
// codeBlock =
// codeBlock + `${fieldNamePascalCase} = model.${fieldNamePascalCase},\n`;
// }
// }
// return `var ${camelCase(authEntity.name)} = new ${authEntity.name}
// {
// ${codeBlock}
// };`;
// };

@@ -368,3 +368,3 @@ import {

isAsync: true,
body: CreateSeedDevelopmentDataBody(resourceName),
body: CreateSeedDevelopmentDataBody(resourceName, context),
type: MethodType.STATIC,

@@ -371,0 +371,0 @@ parameters: [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc