Nexttag.Common
1.0.0
dotnet add package Nexttag.Common --version 1.0.0
NuGet\Install-Package Nexttag.Common -Version 1.0.0
<PackageReference Include="Nexttag.Common" Version="1.0.0" />
<PackageVersion Include="Nexttag.Common" Version="1.0.0" />
<PackageReference Include="Nexttag.Common" />
paket add Nexttag.Common --version 1.0.0
#r "nuget: Nexttag.Common, 1.0.0"
#:package Nexttag.Common@1.0.0
#addin nuget:?package=Nexttag.Common&version=1.0.0
#tool nuget:?package=Nexttag.Common&version=1.0.0
Nexttag.Libs
Bibliotecas NuGet reutilizaveis da Nexttag para .NET 10.
Pacotes
| Pacote | Descricao |
|---|---|
Nexttag.Common |
Tipos base: Result pattern, BaseEntity, PagedResult |
Nexttag.Common.Multitenancy |
Multi-tenancy: TenantProvider, TenantEntity, middleware |
Nexttag.Auth |
Interfaces de autenticacao: IJwtService, ICurrentUserProvider |
Nexttag.Auth.Jwt |
Implementacao JWT com cookie HttpOnly |
Nexttag.Auth.MagicLink |
Login passwordless: magic link OU codigo OTP, single-use, hash SHA-256 |
Nexttag.Auth.NextAuth |
Client HTTP para NextAuth API |
Nexttag.Communication |
Interfaces: email, SMS, notificacoes |
Nexttag.Communication.Email |
Implementacao SendGrid |
Nexttag.Communication.Email.Postmark |
Implementacao Postmark |
Nexttag.Communication.Queue |
RabbitMQ publisher/consumer |
Nexttag.Storage |
Interface de storage |
Nexttag.Storage.R2 |
Implementacao Cloudflare R2 |
Nexttag.Api.Middleware |
Exception handler com ProblemDetails |
Nexttag.Observability |
OpenTelemetry para Grafana/Loki |
Uso
dotnet add package Nexttag.Common
dotnet add package Nexttag.Auth.Jwt
dotnet add package Nexttag.Common.Multitenancy
JWT com cookie HttpOnly
// Program.cs
builder.Services.AddNexttagJwtAuth(builder.Configuration);
// appsettings.json
{
"Jwt": {
"Key": "sua-chave-secreta",
"Issuer": "meu-app",
"Audience": "meu-app",
"ExpirationMinutes": "480",
"CookieName": "meu_token"
}
}
Magic link / código OTP (login passwordless)
// Program.cs — registra IMagicLinkService + suas dependências (Store, Renderer)
builder.Services.AddNexttagMagicLink<MeuStoreEf, MeuRendererPostmark>(builder.Configuration);
// appsettings.json
{
"MagicLink": {
"TokenLengthBytes": 32,
"CodeLength": 6,
"ExpirationMinutes": 15,
"MaxRequestsPerHour": 5
}
}
// Endpoint: solicitar link
[HttpPost("api/auth/magic-link")]
public async Task<IActionResult> Solicitar([FromBody] dynamic body, IMagicLinkService svc)
{
var r = await svc.SolicitarAsync((string)body.email, MagicLinkModo.Link,
new Dictionary<string, string> { ["redirect"] = "/painel" });
if (!r.IsSuccess) return Problem(detail: r.Error!.Message, statusCode: r.Error.StatusCode);
return Ok(new { ok = true, expiraEm = r.Value!.ExpiraEm });
}
// Endpoint: consumir token (verifica e gera JWT)
[HttpGet("api/auth/verify")]
public async Task<IActionResult> Verificar([FromQuery] string token, IMagicLinkService svc, IJwtService jwt)
{
var r = await svc.ConsumirAsync(token);
if (!r.IsSuccess) return Problem(detail: r.Error!.Message, statusCode: r.Error.StatusCode);
// Crie/recupere o usuário e gere o JWT (cookie HttpOnly via Nexttag.Auth.Jwt)
var token = jwt.GerarToken(usuario.Id, r.Value!.Email, usuario.Nome);
Response.Cookies.Append("ela_token", token, new CookieOptions { HttpOnly = true, Secure = true });
return Ok(new { ok = true });
}
Multi-tenancy
// Program.cs
builder.Services.AddMultitenancy();
// Apos UseAuthentication()
app.UseMultitenancy(claimName: "fornecedorId");
// No controller
public class MeuController(ITenantProvider tenant) : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok(new { tenantId = tenant.TenantId });
}
Result pattern
public Result<Usuario> Buscar(Guid id)
{
var user = _db.Usuarios.Find(id);
if (user is null)
return new AppError("not_found", "Usuario nao encontrado", 404);
return user;
}
Build
dotnet build
dotnet test
dotnet pack
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Nexttag.Common:
| Package | Downloads |
|---|---|
|
Nexttag.Auth.Identity.Google
Login social com Google para ASP.NET Identity (Nexttag.Auth.Identity): valida o id_token do Google, acha-ou-cria o usuario e emite JWT local. Sem Firebase. |
|
|
Nexttag.Auth.Identity
ASP.NET Identity integrado: login, registro, roles — banco local sem serviço externo |
|
|
Nexttag.Api.Middleware
Middlewares ASP.NET Core: GlobalExceptionHandler com ProblemDetails (RFC 7807) |
|
|
Nexttag.Auth.MagicLink
Magic link e código OTP para login passwordless. Token aleatório com hash SHA-256, expiração configurável, single-use. |
|
|
Nexttag.Common.Multitenancy
Multi-tenancy: 3 estratégias (QueryFilter, Schema, Database), TenantProvider protegido, middleware configurável, auto query filters |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 372 | 6/7/2026 |