aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Authentication/Token/IProvider.php
blob: ade44a3ee94e40c9c90d1ffbb2e5e37110cca0c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-only
 */
namespace OCP\Authentication\Token;

use OCP\Authentication\Exceptions\ExpiredTokenException;
use OCP\Authentication\Exceptions\InvalidTokenException;
use OCP\Authentication\Exceptions\WipeTokenException;

/**
 * @since 24.0.8
 */
interface IProvider {
	/**
	 * invalidates all tokens of a specific user
	 * if a client name is given only tokens of that client will be invalidated
	 *
	 * @param string $uid
	 * @param string|null $clientName
	 * @since 24.0.8
	 * @return void
	 */
	public function invalidateTokensOfUser(string $uid, ?string $clientName);

	/**
	 * Get a token by token string id
	 *
	 * @since 28.0.0
	 * @throws InvalidTokenException
	 * @throws ExpiredTokenException
	 * @throws WipeTokenException
	 * @return IToken
	 */
	public function getToken(string $tokenId): IToken;
}
82 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843
/*!
 * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
 * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
@use 'sass:math';
@use 'variables';

:root {
	font-size: var(--default-font-size);
	line-height: var(--default-line-height);
}

html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section, main {
	margin: 0;
	padding: 0;
	border: 0;
	font-weight: inherit;
	font-size: 100%;
	font-family: inherit;
	vertical-align: baseline;
	cursor: default;
	scrollbar-color: var(--color-scrollbar);
}

.js-focus-visible :focus:not(.focus-visible) {
	outline: none;
}

/** Let vue apps handle the focus themselves */
.content:not(#content-vue) :focus-visible {
	box-shadow: inset 0 0 0 2px var(--color-primary-element);
	outline: none;
}

html, body {
	height: 100%;
	// disable pull-down-to-refresh on chromium mobile
	overscroll-behavior-y: contain;
}

article, aside, dialog, figure, footer, header, hgroup, nav, section {
	display: block;
}

table {
	border-collapse: separate;
	border-spacing: 0;
	white-space: nowrap;
}

caption, th, td {
	text-align: start;
	font-weight: normal;
}

table, td, th {
	vertical-align: middle;
}

a {
	border: 0;
	color: var(--color-main-text);
	text-decoration: none;
	cursor: pointer;
	* {
		cursor: pointer;
	}
}

a.external {
	margin: 0 3px;
	text-decoration: underline;
}

input {
	cursor: pointer;
	* {
		cursor: pointer;
	}
}

select, .button span, label {
	cursor: pointer;
}

ul {
	list-style: none;
}

body {
	font-weight: normal;
	/* bring the default font size up to 15px */
	font-size: var(--default-font-size);
	line-height: var(--default-line-height);
	font-family: var(--font-face);
	color: var(--color-main-text);
}

.two-factor-header {
	text-align: center;
}

.two-factor-provider {
	text-align: center;
	width: 100% !important;
	display: inline-block;
	margin-bottom: 0 !important;
	background-color: var(--color-background-darker) !important;
	border: none !important;
}

.two-factor-link {
	display: inline-block;
	padding: 12px;
	color: var(--color-text-lighter);
}

.float-spinner {
	height: 32px;
	display: none;
}

#nojavascript {
	position: fixed;
	top: 0;
	bottom: 0;
	inset-inline-start: 0;
	height: 100%;
	width: 100%;
	z-index: 9000;
	text-align: center;
	background-color: var(--color-background-darker);
	color: var(--color-primary-element-text);
	line-height: 125%;
	font-size: 24px;
	div {
		display: block;
		position: relative;
		width: 50%;
		top: 35%;
		margin: 0px auto;
	}
	a {
		color: var(--color-primary-element-text);
		border-bottom: 2px dotted var(--color-main-background);
		&:hover, &:focus {
			color: var(--color-primary-element-text-dark);
		}
	}
}

/* SCROLLING */

::-webkit-scrollbar {
	width: 12px;
	height: 12px
}

::-webkit-scrollbar-corner {
	background-color: transparent;
}

::-webkit-scrollbar-track-piece {
	background-color: transparent;
}

::-webkit-scrollbar-thumb {
	background: var(--color-scrollbar);
	border-radius: var(--border-radius-large);
	border: 2px solid transparent;
	background-clip: content-box;
}


/* SELECTION */

::selection {
	background-color: var(--color-primary-element);
	color: var(--color-primary-element-text);
}


/* CONTENT ------------------------------------------------------------------ */

#app-navigation * {
	box-sizing: border-box;
}

/* EMPTY CONTENT DISPLAY ------------------------------------------------------------ */

#emptycontent,
.emptycontent {
	color: var(--color-text-maxcontrast);
	text-align: center;
	margin-top: 30vh;
	width: 100%;
	#app-sidebar & {
		margin-top: 10vh;
	}
	.emptycontent-search {
		position: static;
	}
	h2 {
		margin-bottom: 10px;
	}
	[class^='icon-'],
	[class*='icon-'] {
		background-size: 64px;
		height: 64px;
		width: 64px;
		margin: 0 auto 15px;
		&:not([class^='icon-loading']),
		&:not([class*='icon-loading']) {
			opacity: .4;
		}
	}
}

/* LOG IN & INSTALLATION ------------------------------------------------------------ */

#datadirContent label {
	width: 100%;
}

/* strengthify wrapper */

/* General new input field look */

/* Nicely grouping input field sets */

.grouptop, .groupmiddle, .groupbottom {
	position: relative;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* Show password toggle */
#show,
#dbpassword {
	position: absolute;
	inset-inline-end: 1em;
	top: .8em;
	/* Cannot use inline-start and :dir to support Samsung Internet */
	float: right;
}

body[dir='rtl'] #show,
body[dir='rtl'] #dbpassword {
	/* Cannot use inline-start and :dir to support Samsung Internet */
	float: left;
}

#show + label, #dbpassword + label {
	inset-inline-end: 21px;
	top: 15px !important;
	margin: -14px !important;
	padding: 14px !important;
}

#show:checked + label, #dbpassword:checked + label, #personal-show:checked + label {
	opacity: .8;
}

#show:focus-visible + label, #dbpassword-toggle:focus-visible + label, #personal-show:focus-visible + label {
	box-shadow: var(--color-primary-element) 0 0 0 2px;
	opacity: 1;
	border-radius: 9999px;
}

#show + label, #dbpassword + label, #personal-show + label {
	position: absolute !important;
	height: 20px;
	width: 24px;
	background-image: var(--icon-toggle-dark);
	background-repeat: no-repeat;
	background-position: center;
	opacity: .3;
}

/* Feedback for keyboard focus and mouse hover */
#show,
#dbpassword,
#personal-show {
	&:focus + label {
		opacity: 1;
	}
	+ label:hover {
		opacity: 1;
	}
}

#show + label:before, #dbpassword + label:before, #personal-show + label:before {
	display: none;
}

#pass2, input[name='personal-password-clone'] {
	padding-inline-end: 30px;
}

.personal-show-container {
	position: relative;
	display: inline-block;
	margin-inline-end: 6px;
}

#personal-show + label {
	display: block;
	inset-inline-end: 0;
	margin-top: -43px;
	margin-inline-end: -4px;
	padding: 22px;
}

/* Warnings and errors are the same */

#body-user .warning, #body-settings .warning {
	margin-top: 8px;
	padding: 5px;
	border-radius: var(--border-radius);
	color: var(--color-main-text);
	background-color: rgba(var(--color-warning-rgb), 0.2);
}

.warning {
	legend, a {
		font-weight: bold !important;
	}
}

.error:not(.toastify) {
	a {
		color: white !important;
		font-weight: bold !important;
		&.button {
			color: var(--color-text-lighter) !important;
			display: inline-block;
			text-align: center;
		}
	}
	pre {
		white-space: pre-wrap;
		text-align: start;
	}
}

.error-wide {
	width: 700px;
	margin-inline-start: -200px !important;
	.button {
		color: black !important;
	}
}

.warning-input {
	border-color: var(--color-error) !important;
}

/* fixes for update page TODO should be fixed some time in a proper way */
/* this is just for an error while updating the Nextcloud instance */

/* Sticky footer */

/* round profile photos */

.avatar, .avatardiv {
	border-radius: 50%;
	flex-shrink: 0;
	&> img {
		border-radius: 50%;
		flex-shrink: 0;
	}
}

td.avatar {
	border-radius: 0;
}

tr .action:not(.permanent), .selectedActions > a {
	opacity: 0;
}

tr {
	.action {
		width: 16px;
		height: 16px;
	}

	&:hover .action:hover,
	&:focus .action:focus {
		opacity: 1;
	}

	&:hover .action:not(.menuitem),
	&:focus .action:not(.menuitem),
	.action.permanent:not(.menuitem) {
		opacity: .5;
	}
}

.selectedActions > a {
	opacity: .5;
	position: relative;
	top: 2px;

	&:hover, &:focus {
		opacity: 1;
	}
}

.selectedActions a {
	&:hover, &:focus {
		opacity: 1;
	}
}

.header-action {
	opacity: .8;

	&:hover, &:focus {
		opacity: 1;
	}
}

tbody tr:not(.group-header) {
	&:hover, &:focus, &:active {
		background-color: var(--color-background-dark);
	}
}

code {
	font-family: 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', monospace;
}

.pager {
	list-style: none;
	float: right;
	display: inline;
	margin: .7em 13em 0 0;
	li {
		display: inline-block;
	}
}

.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
	overflow: hidden;
	text-overflow: ellipsis;
}

.ui-icon-circle-triangle-e {
	background-image: url('../img/actions/play-next.svg?v=1');
}

.ui-icon-circle-triangle-w {
	background-image: url('../img/actions/play-previous.svg?v=1');
}

/* ---- jQuery UI datepicker ---- */
.ui-widget.ui-datepicker {
	margin-top: 10px;
	padding: 4px 8px;
	width: auto;
	border-radius: var(--border-radius);
	border: none;
	z-index: 1600 !important; // above sidebar

	.ui-state-default,
	.ui-widget-content .ui-state-default,
	.ui-widget-header .ui-state-default {
		border: 1px solid transparent;
		background: inherit;
	}
	.ui-widget-header {
		padding: 7px;
		font-size: 13px;
		border:	none;
		background-color: var(--color-main-background);
		color: var(--color-main-text);

		.ui-datepicker-title {
			line-height: 1;
			font-weight: normal;
		}
		.ui-icon {
			opacity: .5;

			&.ui-icon-circle-triangle-e,
			&.ui-icon-circle-triangle-w {
				background-position: center center;
				background-repeat: no-repeat;
			}
		}
		.ui-state-hover .ui-icon {
			opacity: 1;
		}
	}
	.ui-datepicker-calendar {
		th {
			font-weight: normal;
			color: var(--color-text-lighter);
			opacity: .8;
			width: 26px;
			padding: 2px;
		}
		tr:hover {
			background-color: inherit;
		}
		td {
			&.ui-datepicker-today a:not(.ui-state-hover) {
				background-color: var(--color-background-darker);
			}

			&.ui-datepicker-current-day a.ui-state-active,
			.ui-state-hover,
			.ui-state-focus {
				background-color: var(--color-primary-element);
				color: var(--color-primary-element-text);
				font-weight: bold;
			}

			&.ui-datepicker-week-end:not(.ui-state-disabled) :not(.ui-state-hover),
			.ui-priority-secondary:not(.ui-state-hover) {
				color: var(--color-text-lighter);
				opacity: .8;
			}
		}
	}
}

body[dir='ltr'] .ui-widget.ui-datepicker .ui-widget-header .ui-icon {
	&.ui-icon-circle-triangle-e {
		background: url("../img/actions/arrow-right.svg");
	}
	&.ui-icon-circle-triangle-w {
		background: url("../img/actions/arrow-left.svg");
	}
}

body[dir='rtl'] .ui-widget.ui-datepicker .ui-widget-header .ui-icon {
	&.ui-icon-circle-triangle-e {
		background: url("../img/actions/arrow-left.svg");
	}
	&.ui-icon-circle-triangle-w {
		background: url("../img/actions/arrow-right.svg");
	}
}

.ui-datepicker-prev, .ui-datepicker-next {
	border: var(--color-border-dark);
	background: var(--color-main-background);
}


/* ---- jQuery UI timepicker ---- */
.ui-widget.ui-timepicker {
	margin-top: 10px !important;
	width: auto !important;
	border-radius: var(--border-radius);
	z-index: 1600 !important;

	.ui-widget-content {
		border: none !important;
	}

	.ui-state-default,
	.ui-widget-content .ui-state-default,
	.ui-widget-header .ui-state-default {
		border: 1px solid transparent;
		background: inherit;
	}
	.ui-widget-header {
		padding: 7px;
		font-size: 13px;
		border:	none;
		background-color: var(--color-main-background);
		color: var(--color-main-text);

		.ui-timepicker-title {
			line-height: 1;
			font-weight: normal;
		}
	}
	/* AM/PM fix */
	table.ui-timepicker tr .ui-timepicker-hour-cell:first-child {
		margin-inline-start: 30px;
	}
	.ui-timepicker-table {
		th {
			font-weight: normal;
			color: var(--color-text-lighter);
			opacity: .8;
			&.periods {
				padding: 0;
				width: 30px;
				line-height: 30px;
			}
		}
		tr:hover {
			background-color: inherit;
		}
		td {
			&.ui-timepicker-hour-cell a.ui-state-active,
			&.ui-timepicker-minute-cell a.ui-state-active,
			.ui-state-hover,
			.ui-state-focus {
				background-color: var(--color-primary-element);
				color: var(--color-primary-element-text);
				font-weight: bold;
			}

			&.ui-timepicker-minutes:not(.ui-state-hover) {
				color: var(--color-text-lighter);
			}

			&.ui-timepicker-hours {
				border-inline-end: 1px solid var(--color-border);
			}
		}
	}
}

/* ---- jQuery UI datepicker & timepicker global rules ---- */
.ui-widget.ui-datepicker .ui-datepicker-calendar,
.ui-widget.ui-timepicker table.ui-timepicker {
	tr {
		display: flex;
		flex-wrap: nowrap;
		justify-content: space-between;
		td {
			flex: 1 1 auto;
			margin: 0;
			padding: 2px;
			height: 26px;
			width: 26px;
			display: flex;
			align-items: center;
			justify-content: center;
			> * {
				border-radius: 50%;
				text-align: center;
				font-weight: normal;
				color: var(--color-main-text);
				display: block;
				line-height: 18px;
				width: 18px;
				height: 18px;
				padding: 3px;
				font-size: .9em;
			}
		}
	}
}

/* ---- DIALOGS ---- */
.ui-dialog {
	position: fixed !important;
}

span.ui-icon {
	float: left;
	margin-block: 3px 30px;
	margin-inline: 0 7px;
}

/* ---- TOOLTIPS ---- */

.extra-data {
	padding-inline-end: 5px !important;
}

/* ---- TAGS ---- */

#tagsdialog {
	.content {
		width: 100%;
		height: 280px;
	}
	.scrollarea {
		overflow: auto;
		border: 1px solid var(--color-background-darker);
		width: 100%;
		height: 240px;
	}
	.bottombuttons {
		width: 100%;
		height: 30px;
		* {
			float: left;
		}
	}
	.taglist li {
		background: var(--color-background-dark);
		padding: .3em .8em;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		-webkit-transition: background-color 500ms;
		transition: background-color 500ms;
		&:hover, &:active {
			background: var(--color-background-darker);
		}
	}
	.addinput {
		width: 90%;
		clear: both;
	}
}

/* ---- BREADCRUMB ---- */
.breadcrumb {
	display: inline-flex;
	height: 50px;
}

li.crumb {
	display: inline-flex;
	background-image: url('../img/breadcrumb.svg?v=1');
	background-repeat: no-repeat;
	background-position: right center;
	height: 44px;
	background-size: auto 24px;
	flex: 0 0 auto;
	order: 1;
	padding-inline-end: 7px;
	&.crumbmenu {
		order: 2;
		position: relative;
		a {
			opacity: 0.5
		}
		&.canDropChildren,
		&.canDrop {
			.popovermenu {
				display: block;
			}
		}
		// Fix because of the display flex
		.popovermenu {
			top: 100%;
			margin-inline-end: 3px;
			ul {
				max-height: 345px;
				overflow-y: auto;
				overflow-x: hidden;
				padding-inline-end: 5px;
				li.canDrop span:first-child {
					background-image: url('../img/filetypes/folder-drag-accept.svg?v=1') !important;
				}
			}
			.in-breadcrumb {
				display: none;
			}
		}
	}
	&.hidden {
		display: none;
		~ .crumb {
			order: 3;
		}
	}
	> a,
	> span {
		position: relative;
		padding: 12px;
		opacity: 0.5;
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
		flex: 0 0 auto;
		// Some sane max-width for each folder name
		max-width: 200px;

		&.icon-home,
		&.icon-delete {
			// Hide home text
			text-indent: -9999px;
		}
	}
	> a[class^='icon-'] {
		padding: 0;
		width: 44px;
	}

	&:last-child {
		font-weight: bold;
		margin-inline-end: 10px;
		// Allow multiple span next to the main 'a'
		a ~ span {
			padding-inline-start: 0;
		}
	}
	&:hover, &:focus, a:focus, &:active {
		opacity: 1;

		> a,
		> span {
			opacity: .7;
		}
	}
}

/* some feedback for hover/tap on breadcrumbs */

.appear {
	opacity: 1;
	-webkit-transition: opacity 500ms ease 0s;
	-moz-transition: opacity 500ms ease 0s;
	-ms-transition: opacity 500ms ease 0s;
	-o-transition: opacity 500ms ease 0s;
	transition: opacity 500ms ease 0s;
	&.transparent {
		opacity: 0;
	}
}

/* LEGACY FIX only - do not use fieldsets for settings */

fieldset {
	&.warning legend, &.update legend {
		top: 18px;
		position: relative;
	}
	&.warning legend + p, &.update legend + p {
		margin-top: 12px;
	}
}

/* for IE10 */
@-ms-viewport {
	width: device-width;
}


/* hidden input type=file field */

.hiddenuploadfield {
	display: none;
	width: 0;
	height: 0;
	opacity: 0;
}